strncpy warnings fixed: stringop-truncation and stringop-overflow
This commit is contained in:
parent
4eee00101c
commit
a2bef12ce0
4 changed files with 33 additions and 20 deletions
|
|
@ -80,7 +80,7 @@ static inline char * strdup4(char *str)
|
|||
len = align4(strlen(str)+1);
|
||||
if ((dup = (char*) malloc(len)) == NULL)
|
||||
return NULL;
|
||||
strncpy(dup, str, len);
|
||||
memcpy(dup, str, strlen(str)+1);
|
||||
return dup;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue