gh-108753: _Py_PrintSpecializationStats() uses Py_hexdigits (#109040)

This commit is contained in:
Victor Stinner 2023-09-07 04:47:57 +02:00 committed by GitHub
parent f42edf1e7b
commit fd5989bda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -290,8 +290,8 @@ _Py_PrintSpecializationStats(int to_file)
char hex_name[41];
_PyOS_URandomNonblock(rand, 20);
for (int i = 0; i < 20; i++) {
hex_name[2*i] = "0123456789abcdef"[rand[i]&15];
hex_name[2*i+1] = "0123456789abcdef"[(rand[i]>>4)&15];
hex_name[2*i] = Py_hexdigits[rand[i]&15];
hex_name[2*i+1] = Py_hexdigits[(rand[i]>>4)&15];
}
hex_name[40] = '\0';
char buf[64];