summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common.c b/common.c
index 96f1747..91db878 100644
--- a/common.c
+++ b/common.c
@@ -20,12 +20,23 @@ void die(int ret, char *fmtstr, ...)
{
va_list args;
+ fprintf(stderr, "%s: ", progname);
va_start(args, fmtstr);
vfprintf(stderr, fmtstr, args);
va_end(args);
exit(ret);
}
+void errstr(char *fmtstr, ...)
+{
+ va_list args;
+
+ fprintf(stderr, "%s: ", progname);
+ va_start(args, fmtstr);
+ vfprintf(stderr, fmtstr, args);
+ va_end(args);
+}
+
void *smalloc(size_t size)
{
void *ret = malloc(size);