summaryrefslogtreecommitdiff
path: root/lib/libc/src/string
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/src/string')
-rw-r--r--lib/libc/src/string/memcpy.c3
-rw-r--r--lib/libc/src/string/memmove.c1
-rw-r--r--lib/libc/src/string/memset.c3
-rw-r--r--lib/libc/src/string/strcmp.c4
-rw-r--r--lib/libc/src/string/strncmp.c4
5 files changed, 7 insertions, 8 deletions
diff --git a/lib/libc/src/string/memcpy.c b/lib/libc/src/string/memcpy.c
index 9851e07..efbf1bb 100644
--- a/lib/libc/src/string/memcpy.c
+++ b/lib/libc/src/string/memcpy.c
@@ -32,9 +32,8 @@
void *
memcpy(void *dest, const void *src, size_t n)
{
- for (size_t i = 0; i < n; i++) {
+ for (size_t i = 0; i < n; i++)
((char *)dest)[i] = ((char *)src)[i];
- }
return dest;
}
diff --git a/lib/libc/src/string/memmove.c b/lib/libc/src/string/memmove.c
index bbf9a0d..d8a94f7 100644
--- a/lib/libc/src/string/memmove.c
+++ b/lib/libc/src/string/memmove.c
@@ -27,6 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdint.h>
#include <string.h>
void *
diff --git a/lib/libc/src/string/memset.c b/lib/libc/src/string/memset.c
index 928441a..ecceffa 100644
--- a/lib/libc/src/string/memset.c
+++ b/lib/libc/src/string/memset.c
@@ -32,9 +32,8 @@
void *
memset(void *s, int c, size_t n)
{
- for (size_t i = 0; i < n; i++) {
+ for (size_t i = 0; i < n; i++)
((char *)s)[i] = (char)c;
- }
return s;
}
diff --git a/lib/libc/src/string/strcmp.c b/lib/libc/src/string/strcmp.c
index 9d9c5f1..b9e941a 100644
--- a/lib/libc/src/string/strcmp.c
+++ b/lib/libc/src/string/strcmp.c
@@ -32,8 +32,8 @@
int
strcmp(const char *s1, const char *s2)
{
- char *p1 = (char*)s1;
- char *p2 = (char*)s2;
+ char *p1 = (char *)s1;
+ char *p2 = (char *)s2;
while (*p1 || *p2) {
if (*p1 < *p2)
diff --git a/lib/libc/src/string/strncmp.c b/lib/libc/src/string/strncmp.c
index 47d562a..7f4df75 100644
--- a/lib/libc/src/string/strncmp.c
+++ b/lib/libc/src/string/strncmp.c
@@ -32,8 +32,8 @@
int
strncmp(const char *s1, const char *s2, size_t n)
{
- char *p1 = (char*)s1;
- char *p2 = (char*)s2;
+ char *p1 = (char *)s1;
+ char *p2 = (char *)s2;
for (size_t i = 0; i < n; i++) {
if (!*p1 && !*p2)