aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/err.c3
-rw-r--r--src/string/memset.c2
-rw-r--r--src/string/strlen.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/src/err.c b/src/err.c
index f92dd60..caa8d3f 100644
--- a/src/err.c
+++ b/src/err.c
@@ -18,6 +18,7 @@
#include <err.h>
#include <error.h>
#include <errno.h>
+#include <stdlib.h>
@@ -119,6 +120,7 @@ void err(int status, const char* format, ...)
void verr(int status, const char* format, va_list args)
{
verror(status, errno, format, args);
+ exit(status);
}
@@ -154,5 +156,6 @@ void errx(int status, const char* format, ...)
void verrx(int status, const char* format, va_list args)
{
verror(status, 0, format, args);
+ exit(status);
}
diff --git a/src/string/memset.c b/src/string/memset.c
index c0b87a3..f8c153a 100644
--- a/src/string/memset.c
+++ b/src/string/memset.c
@@ -32,7 +32,7 @@ void* memset(void* segment, int c, size_t size)
/* TODO improve implementation of memset */
char* s = segment;
while (size--)
- *s++ = c;
+ *s++ = (char)c;
return segment;
}
diff --git a/src/string/strlen.c b/src/string/strlen.c
index 7a08fa0..a7aece5 100644
--- a/src/string/strlen.c
+++ b/src/string/strlen.c
@@ -18,6 +18,9 @@
#include <string.h>
+# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
+
+
/**
* Returns the number of bytes in a NUL-terminated