mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
Revert "glapi: s/strcpy/strncpy/"
This reverts commit 9446fd8f69.
It doesn't make sense to replace strcpy(a,b) with strncpy(a,b,strlen(b)).
The preceeding code effectively does bounds checking, btw.
This commit is contained in:
parent
cc67bd8799
commit
6405ecb399
1 changed files with 1 additions and 2 deletions
|
|
@ -265,8 +265,7 @@ str_dup(const char *str)
|
|||
copy = (char*) malloc(strlen(str) + 1);
|
||||
if (!copy)
|
||||
return NULL;
|
||||
strncpy(copy, str, strlen(str));
|
||||
copy[strlen(str)] = '\0';
|
||||
strcpy(copy, str);
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue