From 7e1bf77c0be04a34d8c4576f030ffc3ef973ac44 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Wed, 20 Jan 2021 22:42:38 -0600 Subject: kernel: maintain const on strings Keep const pointers const when casting from void to char. Signed-off-by: Danny Holman --- kernel/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/string.c b/kernel/string.c index 5b5957c..30fe40d 100644 --- a/kernel/string.c +++ b/kernel/string.c @@ -1,8 +1,8 @@ #include int memcmp(const void *str1, const void *str2, size_t n) { - unsigned char *p1 = str1; - unsigned char *p2 = str2; + unsigned char const *p1 = str1; + unsigned char const *p2 = str2; int ret = 0; if (str1 == str2) -- cgit v1.2.3