Check all snprintf calls for returning values.

This commit is contained in:
Milan Broz
2022-02-24 15:03:21 +01:00
parent c27d6a89bb
commit 677e06c48a
12 changed files with 79 additions and 40 deletions

View File

@@ -2956,7 +2956,8 @@ static void help_args(struct action_type *action, poptContext popt_context)
{
char buf[128];
snprintf(buf, sizeof(buf), _("%s: requires %s as arguments"), action->type, action->arg_desc);
if (snprintf(buf, sizeof(buf), _("%s: requires %s as arguments"), action->type, action->arg_desc) < 0)
buf[0] = '\0';
usage(popt_context, EXIT_FAILURE, buf, poptGetInvocationName(popt_context));
}