summaryrefslogtreecommitdiffstats
path: root/Modules/pcremodule.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-11-28 20:27:42 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-11-28 20:27:42 (GMT)
commit885d457709c1d680c899dc3d035a47c8fb514cfa (patch)
treed16b3a6f89208a1b46b786958a316ef9075d3fab /Modules/pcremodule.c
parent05bd787c6cd55f29d43465de621778221e0fc46e (diff)
downloadcpython-885d457709c1d680c899dc3d035a47c8fb514cfa.zip
cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.tar.gz
cpython-885d457709c1d680c899dc3d035a47c8fb514cfa.tar.bz2
sprintf -> PyOS_snprintf in some "obviously safe" cases.
Also changed <>-style #includes to ""-style in some places where the former didn't make sense.
Diffstat (limited to 'Modules/pcremodule.c')
-rw-r--r--Modules/pcremodule.c5
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);