Skip to content

Commit 944ddc4

Browse files
committed
Revert "gh-127864: Fix compiler warning (-Wstringop-truncation) (GH-127878)"
This reverts commit 0816738.
1 parent cfeaa99 commit 944ddc4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Python/import.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,10 +1176,9 @@ hashtable_key_from_2_strings(PyObject *str1, PyObject *str2, const char sep)
11761176
return NULL;
11771177
}
11781178

1179-
memcpy(key, str1_data, str1_len);
1179+
strncpy(key, str1_data, str1_len);
11801180
key[str1_len] = sep;
1181-
memcpy(key + str1_len + 1, str2_data, str2_len);
1182-
key[size - 1] = '\0';
1181+
strncpy(key + str1_len + 1, str2_data, str2_len + 1);
11831182
assert(strlen(key) == size - 1);
11841183
return key;
11851184
}

0 commit comments

Comments
 (0)