Skip to content

Commit 649fb60

Browse files
committed
Use while instead of do as advised
1 parent 5cccd68 commit 649fb60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/pwdmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pwd_getpwuid(PyObject *module, PyObject *uidobj)
140140
}
141141
buf = PyMem_RawMalloc(bufsize);
142142

143-
do {
143+
while(1) {
144144
status = getpwuid_r(uid, &pwd, buf, bufsize, &p);
145145
if (p != NULL || status != ERANGE) {
146146
break;
@@ -156,7 +156,7 @@ pwd_getpwuid(PyObject *module, PyObject *uidobj)
156156
break;
157157
}
158158
buf = (char *) p;
159-
} while (1);
159+
}
160160

161161
if (status != 0) {
162162
p = NULL;
@@ -224,7 +224,7 @@ pwd_getpwnam_impl(PyObject *module, PyObject *arg)
224224
}
225225
buf = PyMem_RawMalloc(bufsize);
226226

227-
do {
227+
while(1) {
228228
status = getpwnam_r(name, &pwd, buf, bufsize, &p);
229229
if (p != NULL || status != ERANGE) {
230230
break;
@@ -240,7 +240,7 @@ pwd_getpwnam_impl(PyObject *module, PyObject *arg)
240240
break;
241241
}
242242
buf = (char *) p;
243-
} while (1);
243+
}
244244

245245
if (status != 0) {
246246
p = NULL;

0 commit comments

Comments
 (0)