Instead of using a temporary buffer to store a "reason" string which is later printf()'ed by abortar(), use wwarning() directly and do the small cleanup done by abortar() on the spot.
As this was the only call site for abortar() it can now be removed. The resulting object code gets smaller as a side effect. Signed-off-by: Carlos R. Mafra <[email protected]> --- util/getstyle.c | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-) diff --git a/util/getstyle.c b/util/getstyle.c index 3932962..80c219e 100644 --- a/util/getstyle.c +++ b/util/getstyle.c @@ -148,16 +148,6 @@ void print_help(int print_usage, int exitval) exit(exitval); } -void abortar(char *reason) -{ - printf("%s: %s\n", __progname, reason); - if (ThemePath) { - printf("Removing unfinished theme pack\n"); - (void)wrmdirhier(ThemePath); - } - exit(1); -} - static Bool isFontOption(char *option) { int i; @@ -177,10 +167,11 @@ void findCopyFile(char *dir, char *file) fullPath = wfindfileinarray(PixmapPath, file); if (!fullPath) { - char buffer[4000]; - - sprintf(buffer, "could not find file %s", file); - abortar(buffer); + wwarning("Could not find file %s", file); + if (ThemePath) { + (void)wrmdirhier(ThemePath); + exit(1); + } } copy_file(dir, fullPath, fullPath); free(fullPath); -- 1.7.3.4 -- To unsubscribe, send mail to [email protected].
