summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/util.c b/util.c
index 9df6af953f..7306ddde34 100644
--- a/util.c
+++ b/util.c
@@ -701,6 +701,18 @@ int unoctchar(char c) {
return -1;
}
+char decchar(int x) {
+ return '0' + (x % 10);
+}
+
+int undecchar(char c) {
+
+ if (c >= '0' && c <= '9')
+ return c - '0';
+
+ return -1;
+}
+
char *cescape(const char *s) {
char *r, *t;
const char *f;