glapi: s/strcpy/strncpy/

This commit is contained in:
Vinson Lee
2010-05-01 15:34:47 -07:00
parent 70c7531051
commit 9446fd8f69
+2 -1
View File
@@ -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;
}