tree-wide: make cunescape*() functions return ssize_t

Strictly speaking, we are returning the size of a memory chunk of
arbitrary size, so ssize_t is more appropriate than int.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-07-09 15:07:40 +02:00
parent ddedf7ca69
commit e437538f35
21 changed files with 112 additions and 109 deletions
+4 -3
View File
@@ -176,6 +176,7 @@ int deserialize_dual_timestamp(const char *value, dual_timestamp *t) {
int deserialize_environment(const char *value, char ***list) {
_cleanup_free_ char *unescaped = NULL;
ssize_t l;
int r;
assert(value);
@@ -183,9 +184,9 @@ int deserialize_environment(const char *value, char ***list) {
/* Changes the *environment strv inline. */
r = cunescape(value, 0, &unescaped);
if (r < 0)
return log_error_errno(r, "Failed to unescape: %m");
l = cunescape(value, 0, &unescaped);
if (l < 0)
return log_error_errno(l, "Failed to unescape: %m");
r = strv_env_replace_consume(list, TAKE_PTR(unescaped));
if (r < 0)