projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc67bd8
)
Revert "glapi: s/strcpy/strncpy/"
author
Brian Paul
<brianp@vmware.com>
Mon, 3 May 2010 19:16:11 +0000
(13:16 -0600)
committer
Brian Paul
<brianp@vmware.com>
Mon, 3 May 2010 19:16:11 +0000
(13:16 -0600)
This reverts commit
9446fd8f69564e09ffd0f28735a99c510f84bb62
.
It doesn't make sense to replace strcpy(a,b) with strncpy(a,b,strlen(b)).
The preceeding code effectively does bounds checking, btw.
src/mesa/glapi/glapi_getproc.c
patch
|
blob
|
history
diff --git
a/src/mesa/glapi/glapi_getproc.c
b/src/mesa/glapi/glapi_getproc.c
index ec96ab36f0f7eff64d00292356416fb2e1ab63c9..c73e8dd3b040a7ddfbce7ef59400ee3824b3d9c1 100644
(file)
--- a/
src/mesa/glapi/glapi_getproc.c
+++ b/
src/mesa/glapi/glapi_getproc.c
@@
-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;
}