diff options
Diffstat (limited to 'pw/fileupd.c')
-rw-r--r-- | pw/fileupd.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pw/fileupd.c b/pw/fileupd.c index dc32712..7df4bb1 100644 --- a/pw/fileupd.c +++ b/pw/fileupd.c @@ -29,11 +29,32 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include <stdio.h> +#include <fcntl.h> #include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/param.h> +#include <errno.h> +#include <unistd.h> #include "pwupd.h" int +extendline(char **buf, int * buflen, int needed) +{ + if (needed > *buflen) { + char *tmp = realloc(*buf, needed); + if (tmp == NULL) + return -1; + *buf = tmp; + *buflen = needed; + } + return *buflen; +} + +int extendarray(char ***buf, int * buflen, int needed) { if (needed > *buflen) { |