summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorDan Streetman <ddstreet@ieee.org>2017-01-03 14:31:45 -0500
committerDan Streetman <ddstreet@ieee.org>2017-01-03 17:09:46 -0500
commita9d99b32a34589777e95898dac0597dbfbede4ea (patch)
treefb7e69c8da496dcee5b1df62a6d855a24704b2b9 /src/libudev
parentdc7dd61de610e9330abe7014860acfa733887d5e (diff)
libudev-util: change util_replace_whitespace to return number of chars in dest
Instead of returning 0, which is unhelpful, return the number of chars copied into the dest string. This allows callers that care about that to easily use it, instead of having to calculate the strlen. No current users of the function check the return value, so this does not break any existing code; it is used in the following patch.
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index 574cfeac85..a9819b9db3 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -186,7 +186,7 @@ int util_replace_whitespace(const char *str, char *to, size_t len)
to[j++] = str[i++];
}
to[j] = '\0';
- return 0;
+ return j;
}
/* allow chars in whitelist, plain ascii, hex-escaping and valid utf8 */