changeset 88:981950468c08

if(infile == NULL) return NULL;
author mmj
date Wed, 19 May 2004 20:43:12 +1000
parents 95830c6a36da
children 1589342ec86e
files src/mygetline.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/mygetline.c	Wed May 19 19:28:37 2004 +1000
+++ b/src/mygetline.c	Wed May 19 20:43:12 2004 +1000
@@ -20,6 +20,10 @@
 	char *buf = malloc(buf_size);
 	
 	buf[0] = '\0';
+	
+	if(infile == NULL)
+		return NULL;
+
 	for (;;) {
 		buf_used = strlen(buf);
 		if (fgets(buf+buf_used, buf_size-buf_used, infile) == NULL) {