Skip to content
Snippets Groups Projects
Commit 8f0dec22 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Remove trailing newlines from strings in list returned from findstr_list()

parent 694744fb
No related branches found
No related tags found
No related merge requests found
...@@ -240,6 +240,7 @@ bool find2strs(const char* str1, const char* str2, const char* fname, char* meta ...@@ -240,6 +240,7 @@ bool find2strs(const char* str1, const char* str2, const char* fname, char* meta
static char* process_findstr_item(size_t index, char *str, void* cbdata) static char* process_findstr_item(size_t index, char *str, void* cbdata)
{ {
SKIP_WHITESPACE(str); SKIP_WHITESPACE(str);
truncnl(str);
return c_unescape_str(str); return c_unescape_str(str);
} }
......
...@@ -53,7 +53,7 @@ int maint(const char* fname) ...@@ -53,7 +53,7 @@ int maint(const char* fname)
char item[256]; char item[256];
if(!trash_parse_details(list[i], &trash, item, sizeof item) if(!trash_parse_details(list[i], &trash, item, sizeof item)
|| (prot != NULL && stricmp(trash.prot, prot) != 0)) { || (prot != NULL && stricmp(trash.prot, prot) != 0)) {
fputs(list[i], fp); fprintf(fp, "%s\n", list[i]);
continue; continue;
} }
if(verbosity > 1) { if(verbosity > 1) {
...@@ -75,7 +75,7 @@ int maint(const char* fname) ...@@ -75,7 +75,7 @@ int maint(const char* fname)
continue; continue;
} }
} }
fputs(list[i], fp); fprintf(fp, "%s\n", list[i]);
} }
fclose(fp); fclose(fp);
strListFree(&list); strListFree(&list);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment