Skip to content

Commit 15a24b4

Browse files
committed
Permit trailing whitespace in getenv_int
1 parent 83bbfd1 commit 15a24b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

shared-module/os/getenv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ STATIC os_getenv_err_t common_hal_os_getenv_int_inner(const char *key, mp_int_t
413413
}
414414
char *end;
415415
long num = strtol(buf, &end, 0);
416+
while (unichar_isspace(*end)) {
417+
end++;
418+
}
416419
if (end == buf || *end) { // If the whole buffer was not consumed it's an error
417420
return GETENV_ERR_UNEXPECTED | *end;
418421
}

0 commit comments

Comments
 (0)