@@ -2895,9 +2895,9 @@ posix__getfullpathname(PyObject *self, PyObject *args)
28952895 DWORD result ;
28962896 PyObject * v ;
28972897 result = GetFullPathNameW (wpath ,
2898- sizeof (woutbuf )/ sizeof ( woutbuf [ 0 ] ),
2898+ Py_ARRAY_LENGTH (woutbuf ),
28992899 woutbuf , & wtemp );
2900- if (result > sizeof (woutbuf )/ sizeof ( woutbuf [ 0 ] )) {
2900+ if (result > Py_ARRAY_LENGTH (woutbuf )) {
29012901 woutbufp = malloc (result * sizeof (Py_UNICODE ));
29022902 if (!woutbufp )
29032903 return PyErr_NoMemory ();
@@ -2920,7 +2920,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
29202920 PyUnicode_FSConverter , & opath ))
29212921 return NULL ;
29222922 path = PyBytes_AsString (opath );
2923- if (!GetFullPathName (path , sizeof (outbuf )/ sizeof ( outbuf [ 0 ] ),
2923+ if (!GetFullPathName (path , Py_ARRAY_LENGTH (outbuf ),
29242924 outbuf , & temp )) {
29252925 win32_error ("GetFullPathName" , path );
29262926 Py_DECREF (opath );
@@ -4903,7 +4903,7 @@ static PyObject *
49034903cpu_set_repr (Py_cpu_set * set )
49044904{
49054905 return PyUnicode_FromFormat ("<cpu_set with %li entries>" , set -> ncpus );
4906- }
4906+ }
49074907
49084908static Py_ssize_t
49094909cpu_set_len (Py_cpu_set * set )
@@ -5656,7 +5656,7 @@ posix_getlogin(PyObject *self, PyObject *noargs)
56565656 PyObject * result = NULL ;
56575657#ifdef MS_WINDOWS
56585658 wchar_t user_name [UNLEN + 1 ];
5659- DWORD num_chars = sizeof (user_name )/ sizeof ( user_name [ 0 ] );
5659+ DWORD num_chars = Py_ARRAY_LENGTH (user_name );
56605660
56615661 if (GetUserNameW (user_name , & num_chars )) {
56625662 /* num_chars is the number of unicode chars plus null terminator */
0 commit comments