瀏覽代碼

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.
undefined
Brian Paul 15 年之前
父節點
當前提交
6405ecb399
共有 1 個檔案被更改,包括 1 行新增2 行删除
  1. 1
    2
      src/mesa/glapi/glapi_getproc.c

+ 1
- 2
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;
}


Loading…
取消
儲存