add new hexchar() call

This commit is contained in:
Lennart Poettering 2010-01-28 06:45:04 +01:00
parent 88066b3a67
commit fb624d04e5
2 changed files with 8 additions and 0 deletions

6
util.c
View File

@ -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];
}

2
util.h
View File

@ -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