Browse Source

memcpy sample

David Marec 9 months ago
parent
commit
0c4d102bd2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      testTimer/timerTest.c

+ 1 - 1
testTimer/timerTest.c

@@ -94,7 +94,7 @@ main(int argc, char *argv[])
 
 		names[i] = malloc(MAX_LEN_NAME);
 		if (i == 0) {
-			strncpy(names[i], ".", MAX_LEN_NAME);
+			*((char *) mempcpy (names[i], ".", 1)) = '\0';
 			continue;
 		}
 		if (MAX_LEN_NAME <= snprintf(names[i], MAX_LEN_NAME, "%c", (char)('A' + i - 1))) {