Skip to content

Commit deaf570

Browse files
committed
Fix compiler warning (-Wstringop-truncation)
1 parent 487fdbe commit deaf570

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ hashtable_key_from_2_strings(PyObject *str1, PyObject *str2, const char sep)
11761176
return NULL;
11771177
}
11781178

1179-
strncpy(key, str1_data, str1_len);
1179+
memcpy(key, str1_data, str1_len);
11801180
key[str1_len] = sep;
11811181
strncpy(key + str1_len + 1, str2_data, str2_len + 1);
11821182
assert(strlen(key) == size - 1);

0 commit comments

Comments
 (0)