glapi: s/strcpy/strncpy/
This commit is contained in:
parent
70c7531051
commit
9446fd8f69
|
@ -265,7 +265,8 @@ str_dup(const char *str)
|
|||
copy = (char*) malloc(strlen(str) + 1);
|
||||
if (!copy)
|
||||
return NULL;
|
||||
strcpy(copy, str);
|
||||
strncpy(copy, str, strlen(str));
|
||||
copy[strlen(str)] = '\0';
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue