mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 09:21:26 +03:00
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.
This commit is contained in:
parent
dc7dd61de6
commit
a9d99b32a3
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user