From: Jim Meyering Date: Wed, 8 Mar 2000 14:50:05 +0000 (+0000) Subject: (savedir): Work even if directory size is X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30f76aad48b2a1a28ceff9f9ea30b4eeea2fe3b5;p=pspp (savedir): Work even if directory size is negative; this can happen with some screwy NFS configurations. --- diff --git a/lib/savedir.c b/lib/savedir.c index 29b3842c04..e969407d32 100644 --- a/lib/savedir.c +++ b/lib/savedir.c @@ -89,7 +89,8 @@ savedir (const char *dir, off_t name_size) /* Be sure name_size is at least `1' so there's room for the final NUL byte. */ - name_size += !name_size; + if (name_size <= 0) + name_size = 1; name_space = (char *) malloc (name_size); if (name_space == NULL)