Add the const qualifier to "char *" variables that refer to literal strings. (#4370)

This commit is contained in:
Serhiy Storchaka 2017-11-11 13:06:26 +02:00 • committed by GitHub
parent e184cfd7bf
commit e2f92de6a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 46 additions and 41 deletions

View file

@ -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;
}