diff --git a/ChangeLog b/ChangeLog index 43fd2b52..165a19de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ $Id$ v0.83.6 17-Dec-2005 + mbfile: + Fixed a crash when files.bbs had empty lines. + mbtask: Better messages during servers connections reset. diff --git a/mbfido/mbfimport.c b/mbfido/mbfimport.c index 87d95688..adaacdc9 100644 --- a/mbfido/mbfimport.c +++ b/mbfido/mbfimport.c @@ -115,6 +115,24 @@ void ImportFiles(int Area) while (fgets(String, 4095, fbbs) != NULL) { + /* + * Strip cr and lf characters + */ + for (i = 0; i < strlen(String); i++) { + if (*(String + i) == '\0') + break; + if (*(String + i) == '\n') + *(String + i) = '\0'; + if (*(String + i) == '\r') + *(String + i) = '\0'; + } + + /* + * Stop on an empty line + */ + if (strlen(String) == 0) + break; + if ((String[0] != ' ') && (String[0] != '\t')) { /* * New file entry, check if there has been a file that is not yet saved.