Update dmenu to 5.2.

This commit is contained in:
Bartek Stalewski 2022-10-18 22:53:24 +02:00
parent 11bfdb58a1
commit 5e26689677
8 changed files with 1085 additions and 1086 deletions

View file

@ -6,30 +6,31 @@
#include "util.h"
void *
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);
}
void *
ecalloc(size_t nmemb, size_t size)
{
void *p;
void *p;
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;
}
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);
if (!(p = calloc(nmemb, size)))
die("calloc:");
return p;
}