aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/mem.c
diff options
context:
space:
mode:
authorMarvin Borner2021-04-01 19:39:14 +0200
committerMarvin Borner2021-04-01 19:39:14 +0200
commitafa00abb2b68205bee539d7947130d6b1b1ec6e9 (patch)
tree3a821a75af6c4d4ff1bd4128c4859d77abf87e66 /libs/libc/mem.c
parent4c168fb34c15a1b8981abef7ccef1542a6fb05ca (diff)
Hardened entire system
By using the nonnull attribute and replace buffer-overflow-prone functions like strcpy, strcat and sprintf by strlcpy, strlcat and snprintf.
Diffstat (limited to 'libs/libc/mem.c')
-rw-r--r--libs/libc/mem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/libc/mem.c b/libs/libc/mem.c
index 95242e4..2e457ef 100644
--- a/libs/libc/mem.c
+++ b/libs/libc/mem.c
@@ -64,7 +64,7 @@ void *memcpy(void *dest, const void *src, u32 n)
#endif
}
-void *memset(void *dest, int val, u32 n)
+void *memset(void *dest, u32 val, u32 n)
{
u32 uval = val;
u32 num_dwords = n / 4;
@@ -90,7 +90,7 @@ void *memset(void *dest, int val, u32 n)
return dest;
}
-void *memchr(void *src, int c, u32 n)
+void *memchr(void *src, char c, u32 n)
{
u8 *s = (u8 *)src;