Fix for typo in strndup() function definition.
(cherry picked from commit f46683fd0e
)
This commit is contained in:

committed by
Marcelo Roberto Jimenez

parent
1a574ed6cf
commit
56ab9ba913
@@ -48,7 +48,7 @@
|
|||||||
size_t strsize = strnlen(__string, __n);
|
size_t strsize = strnlen(__string, __n);
|
||||||
char *newstr = (char *)malloc(strsize + 1);
|
char *newstr = (char *)malloc(strsize + 1);
|
||||||
|
|
||||||
strncpy(newstr, __string, newstr);
|
strncpy(newstr, __string, strsize);
|
||||||
newstr[strsize] = 0;
|
newstr[strsize] = 0;
|
||||||
|
|
||||||
return newstr;
|
return newstr;
|
||||||
|
Reference in New Issue
Block a user