-/* $OpenBSD: arguments.c,v 1.55 2022/06/07 10:02:19 nicm Exp $ */
+/* $OpenBSD: arguments.c,v 1.56 2022/08/02 09:23:34 nicm Exp $ */
/*
* Copyright (c) 2010 Nicholas Marriott <nicholas.marriott@gmail.com>
*cause = xstrdup("missing");
return (0);
}
+ if (TAILQ_EMPTY(&entry->values)) {
+ *cause = xstrdup("empty");
+ return (0);
+ }
value = TAILQ_LAST(&entry->values, args_values)->string;
return (args_string_percentage(value, minval, maxval, curval, cause));
}
size_t valuelen = strlen(value);
char *copy;
+ if (valuelen == 0) {
+ *cause = xstrdup("empty");
+ return (0);
+ }
if (value[valuelen - 1] == '%') {
copy = xstrdup(value);
copy[valuelen - 1] = '\0';
*cause = xstrdup("missing");
return (0);
}
+ if (TAILQ_EMPTY(&entry->values)) {
+ *cause = xstrdup("empty");
+ return (0);
+ }
value = TAILQ_LAST(&entry->values, args_values)->string;
return (args_string_percentage_and_expand(value, minval, maxval, curval,
item, cause));