summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarel Zak2010-07-21 14:18:02 +0200
committerKarel Zak2011-01-03 12:28:40 +0100
commit3c5e4ef8881272a97edb2a01649780c9b5bbcf3b (patch)
treef1a5125781371eef547f907ece4e593f5ec69d8a /lib
parentlibmount: remove fs and tab printf functions (diff)
downloadkernel-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.c9
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);