summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-28 06:45:04 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-28 06:45:04 +0100
commitfb624d04e56018defe297eff1d88888b192caeaa (patch)
tree5e27860fac6275204b3d2d601a5fd8e4c71f20f7
parent88066b3a67b78329a02ffca3ac76ba1230de6b12 (diff)
add new hexchar() call
-rw-r--r--util.c6
-rw-r--r--util.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/util.c b/util.c
index 654b93d79c..b166f328b2 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 c3d3aad7b9..fcf380031d 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