mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Add the const qualifier to "char *" variables that refer to literal strings. (#4370)
This commit is contained in:
parent
e184cfd7bf
commit
e2f92de6a9
23 changed files with 46 additions and 41 deletions
|
|
@ -1646,7 +1646,7 @@ _PyMem_DebugCheckAddress(char api, const void *p)
|
|||
{
|
||||
const uint8_t *q = (const uint8_t *)p;
|
||||
char msgbuf[64];
|
||||
char *msg;
|
||||
const char *msg;
|
||||
size_t nbytes;
|
||||
const uint8_t *tail;
|
||||
int i;
|
||||
|
|
@ -1661,7 +1661,7 @@ _PyMem_DebugCheckAddress(char api, const void *p)
|
|||
id = (char)q[-SST];
|
||||
if (id != api) {
|
||||
msg = msgbuf;
|
||||
snprintf(msg, sizeof(msgbuf), "bad ID: Allocated using API '%c', verified using API '%c'", id, api);
|
||||
snprintf(msgbuf, sizeof(msgbuf), "bad ID: Allocated using API '%c', verified using API '%c'", id, api);
|
||||
msgbuf[sizeof(msgbuf)-1] = 0;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue