Commit 5af98f82 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

util: add decchar()/undecchar() calls

parent a9a1e00a
......@@ -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;
......
......@@ -136,6 +136,8 @@ char hexchar(int x);
int unhexchar(char c);
char octchar(int x);
int unoctchar(char c);
char decchar(int x);
int undecchar(char c);
char *cescape(const char *s);
char *cunescape(const char *s);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment