zperror.c - libzahl - big integer library | |
git clone git://git.suckless.org/libzahl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
zperror.c (372B) | |
--- | |
1 /* See LICENSE file for copyright and license details. */ | |
2 #include "internals.h" | |
3 | |
4 #include <stdio.h> | |
5 | |
6 | |
7 void | |
8 zperror(const char *prefix) | |
9 { | |
10 if (libzahl_error >= 0) { | |
11 errno = libzahl_error; | |
12 perror(prefix); | |
13 } else { | |
14 const char *desc; | |
15 zerror(&desc); | |
16 if (prefix && *prefix) | |
17 fprintf(stderr, "%s: %s\n", prefix, desc); | |
18 else | |
19 fprintf(stderr, "%s\n", desc); | |
20 } | |
21 } |