From 977e420a35c2fdbfc220af6223d72eb49e203de8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 24 Feb 2000 00:15:00 +0000 Subject: [PATCH] (savedir): Work even if directory size is negative; this can happen with some NFS screwups. --- lib/savedir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/savedir.c b/lib/savedir.c index 29b3842..e969407 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) -- 2.45.2