From: Lennart Poettering Date: Thu, 28 Jan 2010 05:45:04 +0000 (+0100) Subject: add new hexchar() call X-Git-Tag: 0.git+20100605+dfd8ee-1~363 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb624d04e56018defe297eff1d88888b192caeaa;p=systemd add new hexchar() call --- diff --git a/util.c b/util.c index 654b93d7..b166f328 100644 --- a/util.c +++ b/util.c @@ -547,3 +547,9 @@ char *file_in_same_dir(const char *path, const char *filename) { return r; } + +char hexchar(int x) { + static const char table[16] = "0123456789abcdef"; + + return table[x & 15]; +} diff --git a/util.h b/util.h index c3d3aad7..fcf38003 100644 --- a/util.h +++ b/util.h @@ -105,4 +105,6 @@ int reset_all_signal_handlers(void); char *strstrip(char *s); char *file_in_same_dir(const char *path, const char *filename); +char hexchar(int x); + #endif