mirror of
https://github.com/systemd/systemd.git
synced 2025-03-23 10:50:16 +03:00
util: add decchar()/undecchar() calls
This commit is contained in:
parent
a9a1e00af1
commit
5af98f8284
12
util.c
12
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user