diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-11-28 20:27:42 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-11-28 20:27:42 (GMT) |
commit | 885d457709c1d680c899dc3d035a47c8fb514cfa (patch) | |
tree | d16b3a6f89208a1b46b786958a316ef9075d3fab /Modules/posixmodule.c | |
parent | 05bd787c6cd55f29d43465de621778221e0fc46e (diff) | |
download | cpython-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/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 27e7f1a..365a836 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -432,7 +432,8 @@ os2_strerror(char *msgbuf, int msgbuflen, int errorcode, char *reason) if (rc == NO_ERROR) os2_formatmsg(msgbuf, msglen, reason); else - sprintf(msgbuf, "unknown OS error #%d", errorcode); + PyOS_snprintf(msgbuf, sizeof(msgbuf), + "unknown OS error #%d", errorcode); return msgbuf; } @@ -5814,8 +5815,9 @@ static int insertvalues(PyObject *d) case 40: ver = "4.00"; break; case 50: ver = "5.00"; break; default: - sprintf(tmp, "%d-%d", values[QSV_VERSION_MAJOR], - values[QSV_VERSION_MINOR]); + PyOS_snprintf(tmp, sizeof(tmp), + "%d-%d", values[QSV_VERSION_MAJOR], + values[QSV_VERSION_MINOR]); ver = &tmp[0]; } |