Skip to content
Snippets Groups Projects
Commit 21ceb49e authored by deuce's avatar deuce
Browse files

Unfuck previous commit... don't try memset()ing NULL pointers.

Fixes crash on startup (from sbbs_ini.c:283).
parent 19a0797d
No related branches found
No related tags found
No related merge requests found
......@@ -343,7 +343,6 @@ char* DLLCALL strListCombine(str_list_t list, char* buf, size_t maxlen, const ch
if(maxlen<1)
return(NULL);
memset(buf, 0, maxlen);
if(list==NULL)
return buf;
......@@ -351,6 +350,7 @@ char* DLLCALL strListCombine(str_list_t list, char* buf, size_t maxlen, const ch
if((buf=(char*)malloc(maxlen))==NULL)
return(NULL);
memset(buf, 0, maxlen);
*buf=0;
end=buf+maxlen;
for(i=0, ptr=buf; list[i]!=NULL && buf<end; i++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment