diff options
author | Karel Zak | 2010-07-21 14:18:02 +0200 |
---|---|---|
committer | Karel Zak | 2011-01-03 12:28:40 +0100 |
commit | 3c5e4ef8881272a97edb2a01649780c9b5bbcf3b (patch) | |
tree | f1a5125781371eef547f907ece4e593f5ec69d8a /lib | |
parent | libmount: remove fs and tab printf functions (diff) | |
download | kernel-qcow2-util-linux-3c5e4ef8881272a97edb2a01649780c9b5bbcf3b.tar.gz kernel-qcow2-util-linux-3c5e4ef8881272a97edb2a01649780c9b5bbcf3b.tar.xz kernel-qcow2-util-linux-3c5e4ef8881272a97edb2a01649780c9b5bbcf3b.zip |
libmount: add unmangle/mangle() functions to API
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mangle.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/mangle.c b/lib/mangle.c index 766d479d6..c40e67bad 100644 --- a/lib/mangle.c +++ b/lib/mangle.c @@ -44,7 +44,7 @@ char *mangle(const char *s) return ss; } -void unmangle_to_buffer(char *s, char *buf, size_t len) +void unmangle_to_buffer(const char *s, char *buf, size_t len) { size_t sz = 0; @@ -63,7 +63,7 @@ void unmangle_to_buffer(char *s, char *buf, size_t len) *buf = '\0'; } -static inline char *skip_nonspaces(char *s) +static inline const char *skip_nonspaces(const char *s) { while (*s && !(*s == ' ' || *s == '\t')) s++; @@ -73,9 +73,10 @@ static inline char *skip_nonspaces(char *s) /* * Returns mallocated buffer or NULL in case of error. */ -char *unmangle(char *s) +char *unmangle(const char *s) { - char *buf, *end; + char *buf; + const char *end; size_t sz; end = skip_nonspaces(s); |