$NetBSD: patch-af,v 1.3 2012/11/01 19:27:36 joerg Exp $ --- xcalpr/xcalpr.c.orig 2012-10-30 21:25:09.000000000 +0000 +++ xcalpr/xcalpr.c @@ -59,6 +59,7 @@ static char *copyright = "@(#)Copyrig ***/ #include +#include #include #include #include @@ -86,7 +87,7 @@ static char *daynames[] = {"Sun", "Mon", static char *dayfiles[7]; /* connected contents of any dayfiles */ -static FILE *fout = stdout; +static FILE *fout; static int mon[] = { 31, 28, 31, 30, @@ -100,8 +101,6 @@ static int mon[] = { static char *memerr = "No more memory\n"; static char *usage = "Usage: xcalpr [-d dir][-x][-c][-u user][-f file] [month list]\n"; -char *malloc(); - /* * Routines */ @@ -132,6 +131,8 @@ main(argc, argv) int ac; int yr; + fout = stdout; + while ((c = getopt(argc, argv, "d:u:f:cxv")) != EOF) { switch (c) { @@ -494,7 +495,7 @@ connect_file(filename, bytes) if (statb.st_size == 0) { *bytes = 0; - return; + return NULL; } fibase = readbfile(fd, statb.st_size);