Use strncat() instead of strcat() to silence some warnings.

CID 486616, CID 486617, CID 486615
This commit is contained in:
Christian Heimes 2013-07-20 14:11:28 +02:00
parent 5ea0f80165
commit e91ad501c5
1 changed files with 3 additions and 3 deletions

View File

@ -245,7 +245,7 @@ _do_ioctl_1(int fd, PyObject *args, char *fname, int cmd)
int arg;
assert(strlen(fname) <= 30);
strcat(argfmt, fname);
strncat(argfmt, fname, 30);
if (!PyArg_ParseTuple(args, argfmt, &arg))
return NULL;
@ -270,7 +270,7 @@ _do_ioctl_1_internal(int fd, PyObject *args, char *fname, int cmd)
int arg = 0;
assert(strlen(fname) <= 30);
strcat(argfmt, fname);
strncat(argfmt, fname, 30);
if (!PyArg_ParseTuple(args, argfmt, &arg))
return NULL;
@ -290,7 +290,7 @@ _do_ioctl_0(int fd, PyObject *args, char *fname, int cmd)
int rv;
assert(strlen(fname) <= 30);
strcat(argfmt, fname);
strncat(argfmt, fname, 30);
if (!PyArg_ParseTuple(args, argfmt))
return NULL;