瀏覽代碼

tests/loader.c: stpncpy and stpcpy do not exist on all systems

Nathalie Furmento 13 年之前
父節點
當前提交
c2d57bd1b4
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      tests/loader.c

+ 2 - 2
tests/loader.c

@@ -128,8 +128,8 @@ static void decode(char **src, char *motif, char *value)
 	       char *neo = malloc((strlen(*src)-strlen(motif)+strlen(value)) * sizeof(char));
 	       char *to = neo;
 
-	       to = stpncpy(to, *src, strlen(*src)-strlen(y));
-	       to = stpcpy(to, value);
+	       to = strncpy(to, *src, strlen(*src)-strlen(y)); to += strlen(*src)-strlen(y);
+	       to = strcpy(to, value); to += strlen(value);
 	       to = stpcpy(to, y+strlen(motif));
 
 	       *src = strdup(neo);