Skip to content

Commit c3fa634

Browse files
authored
closes bpo-39736: const strings in Modules/_datetimemodule.c and Modules/_testbuffer.c (GH-18637)
1 parent 4015d1c commit c3fa634

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Modules/_datetimemodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4179,11 +4179,11 @@ static PyObject *
41794179
time_isoformat(PyDateTime_Time *self, PyObject *args, PyObject *kw)
41804180
{
41814181
char buf[100];
4182-
char *timespec = NULL;
4182+
const char *timespec = NULL;
41834183
static char *keywords[] = {"timespec", NULL};
41844184
PyObject *result;
41854185
int us = TIME_GET_MICROSECOND(self);
4186-
static char *specs[][2] = {
4186+
static const char *specs[][2] = {
41874187
{"hours", "%02d"},
41884188
{"minutes", "%02d:%02d"},
41894189
{"seconds", "%02d:%02d:%02d"},
@@ -5415,7 +5415,7 @@ datetime_isoformat(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
54155415
char buffer[100];
54165416
PyObject *result = NULL;
54175417
int us = DATE_GET_MICROSECOND(self);
5418-
static char *specs[][2] = {
5418+
static const char *specs[][2] = {
54195419
{"hours", "%04d-%02d-%02d%c%02d"},
54205420
{"minutes", "%04d-%02d-%02d%c%02d:%02d"},
54215421
{"seconds", "%04d-%02d-%02d%c%02d:%02d:%02d"},

Modules/_testbuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@ static PyObject *
20502050
ndarray_get_format(NDArrayObject *self, void *closure)
20512051
{
20522052
Py_buffer *base = &self->head->base;
2053-
char *fmt = base->format ? base->format : "";
2053+
const char *fmt = base->format ? base->format : "";
20542054
return PyUnicode_FromString(fmt);
20552055
}
20562056

0 commit comments

Comments
 (0)