Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7234479

Browse files
author
Victor Stinner
committed
Issue #9611: remove useless and dangerous explicit conversion to size_t
1 parent 51e2107 commit 7234479

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/_io/fileio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ fileio_readinto(fileio *self, PyObject *args)
530530
len = INT_MAX;
531531
n = read(self->fd, pbuf.buf, (int)len);
532532
#else
533-
n = read(self->fd, pbuf.buf, (size_t)len);
533+
n = read(self->fd, pbuf.buf, len);
534534
#endif
535535
Py_END_ALLOW_THREADS
536536
} else
@@ -716,7 +716,7 @@ fileio_write(fileio *self, PyObject *args)
716716
len = INT_MAX;
717717
n = write(self->fd, pbuf.buf, (int)len);
718718
#else
719-
n = write(self->fd, pbuf.buf, (size_t)len);
719+
n = write(self->fd, pbuf.buf, len);
720720
#endif
721721
Py_END_ALLOW_THREADS
722722
} else

Modules/posixmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5712,7 +5712,7 @@ posix_write(PyObject *self, PyObject *args)
57125712
len = INT_MAX;
57135713
size = write(fd, pbuf.buf, (int)len);
57145714
#else
5715-
size = write(fd, pbuf.buf, (size_t)len);
5715+
size = write(fd, pbuf.buf, len);
57165716
#endif
57175717
Py_END_ALLOW_THREADS
57185718
PyBuffer_Release(&pbuf);

0 commit comments

Comments
 (0)