* xlat.c (printxvals_ex): Change "str" variable visibility to the whole
function, jump to va_end instead of duplicating call and return, return
!!str.
return 0;
}
+ const char *str = NULL;
va_list args;
va_start(args, xlat);
for (; xlat; xlat = va_arg(args, const struct xlat *)) {
- const char *str = xlookup(xlat, val);
+ str = xlookup(xlat, val);
if (str) {
if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) {
tprints(str);
}
- va_end(args);
- return 1;
+ goto printxvals_ex_end;
}
}
+
/* No hits -- print raw # instead. */
print_xlat_val(val, style);
tprints_comment(dflt);
+printxvals_ex_end:
va_end(args);
- return 0;
+ return !!str;
}
int