[Python-checkins] CVS: python/dist/src/Modules almodule.c,1.33,1.34 posixmodule.c,2.211,2.212 socketmodule.c,1.198,1.199 stropmodule.c,2.83,2.84
Tim Peters
tim_one@users.sourceforge.net
Wed, 28 Nov 2001 14:07:33 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv4133/python/Modules
Modified Files:
almodule.c posixmodule.c socketmodule.c stropmodule.c
Log Message:
More sprintf -> PyOS_snprintf.
Index: almodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/almodule.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** almodule.c 2001/11/03 10:48:43 1.33
--- almodule.c 2001/11/28 22:07:30 1.34
***************
*** 1520,1524 ****
if (pvs[i].sizeOut < 0) {
char buf[32];
! sprintf(buf, "problem with param %d", i);
PyErr_SetString(ErrorObject, buf);
goto error;
--- 1520,1525 ----
if (pvs[i].sizeOut < 0) {
char buf[32];
! PyOS_snprintf(buf, sizeof(buf),
! "problem with param %d", i);
PyErr_SetString(ErrorObject, buf);
goto error;
Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.211
retrieving revision 2.212
diff -C2 -d -r2.211 -r2.212
*** posixmodule.c 2001/11/28 20:32:57 2.211
--- posixmodule.c 2001/11/28 22:07:30 2.212
***************
*** 2556,2560 ****
s2 = (char *)_alloca(x);
ZeroMemory(s2, x);
! sprintf(s2, "%s%s%s", s1, s3, cmdstring);
}
else {
--- 2556,2560 ----
s2 = (char *)_alloca(x);
ZeroMemory(s2, x);
! PyOS_snprintf(s2, x, "%s%s%s", s1, s3, cmdstring);
}
else {
***************
*** 2609,2614 ****
s2 = (char *)_alloca(x);
ZeroMemory(s2, x);
! sprintf(
! s2,
"%s \"%s%s%s\"",
modulepath,
--- 2609,2614 ----
s2 = (char *)_alloca(x);
ZeroMemory(s2, x);
! PyOS_snprintf(
! s2, x,
"%s \"%s%s%s\"",
modulepath,
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -C2 -d -r1.198 -r1.199
*** socketmodule.c 2001/11/28 20:27:42 1.198
--- socketmodule.c 2001/11/28 22:07:30 1.199
***************
*** 3090,3094 ****
}
! sprintf(reason, "OS/2 TCP/IP Error# %d", sock_errno());
PyErr_SetString(PyExc_ImportError, reason);
--- 3090,3095 ----
}
! PyOS_snprintf(reason, sizeof(reason),
! "OS/2 TCP/IP Error# %d", sock_errno());
PyErr_SetString(PyExc_ImportError, reason);
Index: stropmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/stropmodule.c,v
retrieving revision 2.83
retrieving revision 2.84
diff -C2 -d -r2.83 -r2.84
*** stropmodule.c 2001/11/28 20:27:42 2.83
--- stropmodule.c 2001/11/28 22:07:30 2.84
***************
*** 779,783 ****
}
else if (errno != 0) {
! sprintf(buffer, "atoi() literal too large: %.200s", s);
PyErr_SetString(PyExc_ValueError, buffer);
return NULL;
--- 779,784 ----
}
else if (errno != 0) {
! PyOS_snprintf(buffer, sizeof(buffer),
! "atoi() literal too large: %.200s", s);
PyErr_SetString(PyExc_ValueError, buffer);
return NULL;
***************
*** 829,833 ****
end++;
if (*end != '\0') {
! sprintf(buffer, "invalid literal for atol(): %.200s", s);
PyErr_SetString(PyExc_ValueError, buffer);
Py_DECREF(x);
--- 830,835 ----
end++;
if (*end != '\0') {
! PyOS_snprintf(buffer, sizeof(buffer),
! "invalid literal for atol(): %.200s", s);
PyErr_SetString(PyExc_ValueError, buffer);
Py_DECREF(x);