diff --git a/prwtmp/GNUmakefile b/prwtmp/GNUmakefile index ee1a01c..dbcf70e 100644 --- a/prwtmp/GNUmakefile +++ b/prwtmp/GNUmakefile @@ -1,5 +1,5 @@ -CC = gcc -Wall -INSTALL = /usr/local/bin/install +include GNUmakevars +include GNUmakerules prwtmp: diff --git a/prwtmp/prwtmp.c b/prwtmp/prwtmp.c index b49b0c8..13cc2a8 100644 --- a/prwtmp/prwtmp.c +++ b/prwtmp/prwtmp.c @@ -1,10 +1,15 @@ char prwtmp_c_rcs_id[] = - "$Id: prwtmp.c,v 1.1 1997-01-13 14:59:40 hjp Exp $"; + "$Id: prwtmp.c,v 1.2 1998-05-28 16:18:21 hjp Exp $"; /* * prwtmp - print wtmp to stdout * * $Log: prwtmp.c,v $ - * Revision 1.1 1997-01-13 14:59:40 hjp + * Revision 1.2 1998-05-28 16:18:21 hjp + * use GNUmakerules/GNUmakevars for CC and INSTALL. + * Bug fix: initial offset wasn't initialized + * Bug fix: #include and a cast (both needed for glibc2) + * + * Revision 1.1 1997/01/13 14:59:40 hjp * Checked into CVS. * Added -o and -s options. * @@ -17,6 +22,7 @@ char prwtmp_c_rcs_id[] = #include #include +#include #include char *cmnd; @@ -31,7 +37,7 @@ int main (int argc, char **argv) { FILE *fp; struct utmp u; char *filename = WTMP_FILE; - long off; + long off = 0; int print_offset = 0; int c; char *p; @@ -96,7 +102,7 @@ int main (int argc, char **argv) { (int)sizeof(u.ut_host), (int)sizeof(u.ut_host), u.ut_host); - printf("%08lx", u.ut_addr); + printf("%08lx", (unsigned long)u.ut_addr); printf("\n"); }