$NetBSD: patch-aa,v 1.2 2011/08/01 05:37:12 dholland Exp $ Use malloc correctly. Don't declare own errno. Needs unistd.h. --- leapsecs_read.c.orig 1998-10-13 16:52:20.000000000 +0000 +++ leapsecs_read.c @@ -2,7 +2,9 @@ #include #include #include -extern int errno; +#include +#include + #include "tai.h" #include "leapsecs.h" @@ -29,7 +31,7 @@ int leapsecs_read() if (fstat(fd,&st) == -1) { close(fd); return -1; } - t = (struct tai *) malloc(st.st_size); + t = malloc(st.st_size); if (!t) { close(fd); return -1; } n = read(fd,(char *) t,st.st_size);