diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-21 08:35:20 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-21 08:35:20 +0100 |
commit | 646acebd58859d6f122918f9505f06dd971812cd (patch) | |
tree | ec9befeb969474e698f77e881ae9810f596bca71 /src/libudev/libudev-util.c | |
parent | libudev-util: add assertions (diff) | |
download | systemd-646acebd58859d6f122918f9505f06dd971812cd.tar.xz systemd-646acebd58859d6f122918f9505f06dd971812cd.zip |
libudev-util: make util_replace_*() return size_t
Diffstat (limited to 'src/libudev/libudev-util.c')
-rw-r--r-- | src/libudev/libudev-util.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c index d6362cac0c..4f88805ce1 100644 --- a/src/libudev/libudev-util.c +++ b/src/libudev/libudev-util.c @@ -129,7 +129,7 @@ size_t util_path_encode(const char *src, char *dest, size_t size) { * Note this may be called with 'str' == 'to', i.e. to replace whitespace * in-place in a buffer. This function can handle that situation. */ -int util_replace_whitespace(const char *str, char *to, size_t len) { +size_t util_replace_whitespace(const char *str, char *to, size_t len) { size_t i, j; assert(str); @@ -160,9 +160,8 @@ int util_replace_whitespace(const char *str, char *to, size_t len) { } /* allow chars in whitelist, plain ascii, hex-escaping and valid utf8 */ -int util_replace_chars(char *str, const char *white) { - size_t i = 0; - int replaced = 0; +size_t util_replace_chars(char *str, const char *white) { + size_t i = 0, replaced = 0; assert(str); |