summaryrefslogtreecommitdiff
path: root/source3/lib/util_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util_file.c')
-rw-r--r--source3/lib/util_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c
index 01a8b1c333..a92eb15333 100644
--- a/source3/lib/util_file.c
+++ b/source3/lib/util_file.c
@@ -282,13 +282,15 @@ char *fgets_slash(char *s2,int maxlen,FILE *f)
if (feof(f))
return(NULL);
+ if (maxlen <2) return(NULL);
+
if (!s2)
{
maxlen = MIN(maxlen,8);
s = (char *)Realloc(s,maxlen);
}
- if (!s || maxlen < 2) return(NULL);
+ if (!s) return(NULL);
*s = 0;