diff options
Diffstat (limited to 'Modules/pcremodule.c')
-rw-r--r-- | Modules/pcremodule.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/pcremodule.c b/Modules/pcremodule.c index e34c002..7a8900d 100644 --- a/Modules/pcremodule.c +++ b/Modules/pcremodule.c @@ -263,7 +263,8 @@ PyPcre_expand_escape(unsigned char *pattern, int pattern_len, case('U'): case('l'): case('u'): { char message[50]; - sprintf(message, "\\%c is not allowed", c); + PyOS_snprintf(message, sizeof(message), + "\\%c is not allowed", c); PyErr_SetString(ErrorObject, message); return NULL; } @@ -495,7 +496,7 @@ PyPcre_expand(PyObject *self, PyObject *args) if (result==Py_None) { char message[50]; - sprintf(message, + PyOS_snprintf(message, sizeof(message), "group did not contribute to the match"); PyErr_SetString(ErrorObject, message); |