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 -6
View File
@@ -585,8 +585,8 @@ _public_ int sd_session_get_class(const char *session, char **class) {
_public_ int sd_session_get_desktop(const char *session, char **desktop) {
_cleanup_free_ char *escaped = NULL;
char *t;
int r;
ssize_t l;
assert_return(desktop, -EINVAL);
@@ -594,11 +594,9 @@ _public_ int sd_session_get_desktop(const char *session, char **desktop) {
if (r < 0)
return r;
r = cunescape(escaped, 0, &t);
if (r < 0)
return r;
*desktop = t;
l = cunescape(escaped, 0, desktop);
if (l < 0)
return l;
return 0;
}