aboutsummaryrefslogtreecommitdiffstats
path: root/eprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'eprintf.c')
-rw-r--r--eprintf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/eprintf.c b/eprintf.c
index 41c043f..2aea355 100644
--- a/eprintf.c
+++ b/eprintf.c
@@ -1,9 +1,10 @@
+#include <assert.h>
#include <errno.h>
#include <stdarg.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdint.h>
#include "eprintf.h"
@@ -15,6 +16,8 @@ void eprintf(const char *fmt, ...)
int errnum = errno;
va_list va;
+ assert(fmt);
+
if (progname() != NULL)
fprintf(stderr, "%s: ", progname());
@@ -35,6 +38,8 @@ void weprintf(const char *fmt, ...)
int errnum = errno;
va_list va;
+ assert(fmt);
+
if (progname() != NULL)
fprintf(stderr, "%s: ", progname());
@@ -53,6 +58,8 @@ char *estrdup(const char *s)
size_t len;
char *dup;
+ assert(s);
+
len = strlen(s);
if (len == SIZE_MAX)
eprintf("estrdup(\"%.20s\") failed: Too long", s);