Changes are made.

This commit is contained in:
Cevdet Arda Haran 2022-12-02 12:59:37 +03:00
parent 6f3265185a
commit 3799897bcb
13 changed files with 21 additions and 1412 deletions

6
util.c
View file

@ -1,26 +1,21 @@
/* See LICENSE.dwm file for copyright and license details. */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "util.h"
void
die(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
fputc(' ', stderr);
perror(NULL);
} else {
fputc('\n', stderr);
}
exit(1);
}
@ -28,7 +23,6 @@ void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;