Skip to content

Commit 990ae04

Browse files
committed
strtoull is valid if nr ends with \r or \n
1 parent d17793b commit 990ae04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/psram_unique_ptr.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ void unicodeToUTF8(const char* src) {
14621462
const char* str = get();
14631463
char* end = nullptr;
14641464
uint64_t result = std::strtoull(str, &end, base);
1465-
if (end == str || *end != '\0') {
1465+
if (end == str) {
14661466
log_e("to_uint64: Invalid numeric value in '%s' for base %d", str, base);
14671467
return 0;
14681468
}
@@ -1487,7 +1487,7 @@ void unicodeToUTF8(const char* src) {
14871487
const char* str = get();
14881488
char* end = nullptr;
14891489
unsigned long result = std::strtoul(str, &end, base);
1490-
if (end == str || *end != '\0') {
1490+
if (end == str) {
14911491
log_e("to_uint32: Invalid numeric value in '%s' for base %d", str, base);
14921492
return 0;
14931493
}

0 commit comments

Comments
 (0)