Patch from larry doolittle to make sure we don't realloc

a pointer that was not yet malloced mem.
This commit is contained in:
Eric Andersen 2000-12-11 20:29:13 +00:00
parent 5a964f9d0b
commit d323d32c5b
2 changed files with 2 additions and 0 deletions

View File

@ -151,6 +151,7 @@ extern int logger_main(int argc, char **argv)
} else {
if (argc >= 1) {
int len = 1; /* for the '\0' */
message=xcalloc(1, 1);
for (; *argv != NULL; argv++) {
len += strlen(*argv);
len += 1; /* for the space between the args */

View File

@ -151,6 +151,7 @@ extern int logger_main(int argc, char **argv)
} else {
if (argc >= 1) {
int len = 1; /* for the '\0' */
message=xcalloc(1, 1);
for (; *argv != NULL; argv++) {
len += strlen(*argv);
len += 1; /* for the space between the args */