diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-09 01:04:43 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-09 01:05:15 -0400 |
commit | 6c068566ce195746b0e0b1e28e84d7220cfc58f9 (patch) | |
tree | a7d52bd24dfd0eb7ed7da122df406959d34d72df /lib | |
parent | 37d7d9cb50ac2f4ab02400d293e913905df1cb8d (diff) |
usr: bin: Make 's' const within atoi()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/include/string.h | 2 | ||||
-rw-r--r-- | lib/libc/src/string/atoi.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/include/string.h b/lib/libc/include/string.h index 8ba2b4e..50981c4 100644 --- a/lib/libc/include/string.h +++ b/lib/libc/include/string.h @@ -42,6 +42,6 @@ int memcmp(const void *s1, const void *s2, size_t n); char *itoa(int64_t value, char *buf, int base); void *memcpy(void *dest, const void *src, size_t n); int strcmp(const char *s1, const char *s2); -int atoi(char *s); +int atoi(const char *s); #endif /* !_STRING_H_ */ diff --git a/lib/libc/src/string/atoi.c b/lib/libc/src/string/atoi.c index 24943da..920e561 100644 --- a/lib/libc/src/string/atoi.c +++ b/lib/libc/src/string/atoi.c @@ -32,7 +32,7 @@ #define IS_DIGIT(C) ((C >= '0' && C <= '9')) int -atoi(char *s) +atoi(const char *s) { int n, sign; |