Skip to content
Snippets Groups Projects
Commit 393e6b27 authored by deuce's avatar deuce
Browse files

Check return value of vsnprintf()

parent 7159911e
No related branches found
No related tags found
No related merge requests found
......@@ -686,6 +686,8 @@ int ciolib_cprintf(char *fmat, ...)
ret=_vsnprintf(str,sizeof(str)-1,fmat,argptr);
#else
ret=vsnprintf(NULL,0,fmat,argptr);
if(ret<0)
return(EOF);
str=(char *)malloc(ret+1);
if(str==NULL)
return(EOF);
......
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