From: Christian Brauner Date: Wed, 9 Dec 2020 08:58:52 +0000 (+0100) Subject: confile_utils: cleanup set_config_string_item_max() X-Git-Tag: lxc-5.0.0~330^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21af2fbed116d5b1ef7c249a3050dea3345efbef;p=thirdparty%2Flxc.git confile_utils: cleanup set_config_string_item_max() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c index 474ac58d1..562b18317 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -642,10 +642,8 @@ int set_config_string_item(char **conf_item, const char *value) int set_config_string_item_max(char **conf_item, const char *value, size_t max) { - if (strlen(value) >= max) { - ERROR("%s is too long (>= %lu)", value, (unsigned long)max); - return -1; - } + if (strlen(value) >= max) + return log_error_errno(-ENAMETOOLONG, ENAMETOOLONG, "%s is too long (>= %lu)", value, (unsigned long)max); return set_config_string_item(conf_item, value); }