diff -upr rarian-0.5.6-pre/librarian/rarian-reg-utils.c rarian-0.5.6-post/librarian/rarian-reg-utils.c --- rarian-0.5.6-pre/librarian/rarian-reg-utils.c 2007-07-31 12:16:06.000000000 -0500 +++ rarian-0.5.6-post/librarian/rarian-reg-utils.c 2007-08-23 23:26:22.000000000 -0500 @@ -97,13 +97,18 @@ rrn_reg_parse_file (char *filename) char *tmp; char *result = NULL; tmp = strdup (buf); - buf = fgets (buf, 1023, file); + if (fgets (buf, 1023, file)) { result = malloc (sizeof (char) * (strlen(tmp)+strlen(buf)+2)); strcpy (result, tmp); strcat (result, buf); free (tmp); free (buf); - buf = result; + buf = result; + } else { + free (buf); + buf = tmp; + break; + } } real = buf; while (*real && isspace(*real) && *real != '\n') {