glapi: s/strcpy/strncpy/

This commit is contained in:
Vinson Lee 2010-05-01 15:34:47 -07:00
parent 70c7531051
commit 9446fd8f69
1 changed files with 2 additions and 1 deletions

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;
}