Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Unified Diff: lib/libc/atoi.c

Issue 1731653002: Allow for null endptr (Closed) Base URL: https://github.com/littlekernel/lk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/libc/atoi.c
diff --git a/lib/libc/atoi.c b/lib/libc/atoi.c
index d641e00d536fdafdd8cb5ec6ecd968afdaf67978..8f334c85cc1733597287c97c2803bfc688f51c44 100644
--- a/lib/libc/atoi.c
+++ b/lib/libc/atoi.c
@@ -166,7 +166,9 @@ unsigned long strtoul(const char *nptr, char **endptr, int base)
}
if (v < 0 || v >= base) {
- *endptr = (char *) nptr;
+ if (endptr) {
+ *endptr = (char *) nptr;
+ }
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698