summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-03-08 14:50:05 +0000
committerJim Meyering <jim@meyering.net>2000-03-08 14:50:05 +0000
commit7157c29ee8eca1f3c23cd87fddb2e52501dd0fe9 (patch)
tree562ef6600beae0f368c4af6d3ce91c0ad339f77c /lib
parent45b3b0a96daede1b7165d9767f412f4b6422ed30 (diff)
downloadcoreutils-7157c29ee8eca1f3c23cd87fddb2e52501dd0fe9.tar.xz
(savedir): Work even if directory size is
negative; this can happen with some screwy NFS configurations.
Diffstat (limited to 'lib')
-rw-r--r--lib/savedir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/savedir.c b/lib/savedir.c
index 29b3842c0..e969407d3 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)