string-util: imply NULL termination of strextend() argument list
The trailing NULL in the argument list is now implied (similar to what we already have in place in strjoin()).
This commit is contained in:
@@ -1159,7 +1159,7 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to unescape text '%s': %m", eq);
|
||||
|
||||
if (!strextend(&unescaped, "\n", NULL))
|
||||
if (!strextend(&unescaped, "\n"))
|
||||
return log_oom();
|
||||
|
||||
/* Note that we don't expand specifiers here, but that should be OK, as this is a programmatic
|
||||
|
||||
@@ -343,7 +343,7 @@ int config_parse(
|
||||
return -ENOBUFS;
|
||||
}
|
||||
|
||||
if (!strextend(&continuation, l, NULL)) {
|
||||
if (!strextend(&continuation, l)) {
|
||||
if (flags & CONFIG_PARSE_WARN)
|
||||
log_oom();
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1340,12 +1340,12 @@ static int mount_partition(
|
||||
if (asprintf(&uid_option, "uid=" UID_FMT ",gid=" GID_FMT, uid_shift, (gid_t) uid_shift) < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!strextend_with_separator(&options, ",", uid_option, NULL))
|
||||
if (!strextend_with_separator(&options, ",", uid_option))
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (!isempty(m->mount_options))
|
||||
if (!strextend_with_separator(&options, ",", m->mount_options, NULL))
|
||||
if (!strextend_with_separator(&options, ",", m->mount_options))
|
||||
return -ENOMEM;
|
||||
|
||||
if (FLAGS_SET(flags, DISSECT_IMAGE_MKDIR)) {
|
||||
|
||||
@@ -733,7 +733,7 @@ int mount_option_mangle(
|
||||
}
|
||||
|
||||
/* If 'word' is not a mount flag, then store it in '*ret_remaining_options'. */
|
||||
if (!ent->name && !strextend_with_separator(&ret, ",", word, NULL))
|
||||
if (!ent->name && !strextend_with_separator(&ret, ",", word))
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ int namespace_flags_to_string(unsigned long flags, char **ret) {
|
||||
if ((flags & namespace_flag_map[i].flag) != namespace_flag_map[i].flag)
|
||||
continue;
|
||||
|
||||
if (!strextend_with_separator(&s, " ", namespace_flag_map[i].name, NULL))
|
||||
if (!strextend_with_separator(&s, " ", namespace_flag_map[i].name))
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user