From 6c068566ce195746b0e0b1e28e84d7220cfc58f9 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 9 Jul 2025 01:04:43 -0400 Subject: usr: bin: Make 's' const within atoi() Signed-off-by: Ian Moffett --- lib/libc/include/string.h | 2 +- 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; -- cgit v1.2.3