Commit 1cf9deb6 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Using mallocstrcpy() in a correct manner and

not letting it free an unrelated string.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5193 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 4e5ea183
Showing with 4 additions and 2 deletions
+4 -2
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
first_file() and last_file(). Also unbind some other useless keys. first_file() and last_file(). Also unbind some other useless keys.
* src/browser.c (filesearch_init): Remove an unused variable, and * src/browser.c (filesearch_init): Remove an unused variable, and
adjust the introductory comment for the recently tweaked logic. adjust the introductory comment for the recently tweaked logic.
* src/rcfile.c (parse_linter, parse_formatter): Use mallocstrcpy()
in a correct manner; don't let it free an unrelated string.
2015-04-11 Benno Schulenberg <bensberg@justemail.net> 2015-04-11 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (do_replace_loop): Do not split off the marked region * src/search.c (do_replace_loop): Do not split off the marked region
......
...@@ -992,7 +992,7 @@ void parse_linter(char *ptr) ...@@ -992,7 +992,7 @@ void parse_linter(char *ptr)
if (!strcmp(ptr, "\"\"")) if (!strcmp(ptr, "\"\""))
endsyntax->linter = NULL; endsyntax->linter = NULL;
else else
endsyntax->linter = mallocstrcpy(syntaxes->linter, ptr); endsyntax->linter = mallocstrcpy(NULL, ptr);
} }
#ifndef DISABLE_SPELLER #ifndef DISABLE_SPELLER
...@@ -1019,7 +1019,7 @@ void parse_formatter(char *ptr) ...@@ -1019,7 +1019,7 @@ void parse_formatter(char *ptr)
if (!strcmp(ptr, "\"\"")) if (!strcmp(ptr, "\"\""))
endsyntax->formatter = NULL; endsyntax->formatter = NULL;
else else
endsyntax->formatter = mallocstrcpy(syntaxes->formatter, ptr); endsyntax->formatter = mallocstrcpy(NULL, ptr);
} }
#endif /* !DISABLE_SPELLER */ #endif /* !DISABLE_SPELLER */
#endif /* !DISABLE_COLOR */ #endif /* !DISABLE_COLOR */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment