Skip to content

Commit 19209c6

Browse files
committed
Fix typo & add type casts
1 parent 28b4b6e commit 19209c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/posixmodule.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ path_converter(PyObject *o, void *p)
13071307
goto error_exit;
13081308
}
13091309
#endif
1310-
if (!path->null_embeddable && wcslen(wide) != length) {
1310+
if (!path->null_embeddable && wcslen(wide) != (size_t)length) {
13111311
FORMAT_EXCEPTION(PyExc_ValueError,
13121312
"embedded null character in %s");
13131313
goto error_exit;
@@ -1361,7 +1361,7 @@ path_converter(PyObject *o, void *p)
13611361

13621362
length = PyBytes_GET_SIZE(bytes);
13631363
narrow = PyBytes_AS_STRING(bytes);
1364-
if (!path->null_embeddable && (size_t)length != strlen(narrow)) {
1364+
if (!path->null_embeddable && strlen(narrow) != (size_t)length) {
13651365
FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
13661366
goto error_exit;
13671367
}
@@ -1385,7 +1385,7 @@ path_converter(PyObject *o, void *p)
13851385
goto error_exit;
13861386
}
13871387
#endif
1388-
if (!path->null_embeddable && wcslen(wide) != length) {
1388+
if (!path->null_embeddable && wcslen(wide) != (size_t)length) {
13891389
FORMAT_EXCEPTION(PyExc_ValueError,
13901390
"embedded null character in %s");
13911391
goto error_exit;
@@ -1394,7 +1394,7 @@ path_converter(PyObject *o, void *p)
13941394
#ifdef MS_WINDOWS
13951395
path->narrow = TRUE;
13961396
#else
1397-
path->narrow = narrow
1397+
path->narrow = narrow;
13981398
#endif
13991399
Py_DECREF(bytes);
14001400
wide = NULL;

0 commit comments

Comments
 (0)