From 9d1557979dc66f193e7a899a6798eacffbd6f25a Mon Sep 17 00:00:00 2001 From: "Steffen \"Daode\" Nurpmeso" Date: Tue, 23 Oct 2012 14:26:29 +0200 Subject: [PATCH] collect.c: expand() may fail --- collect.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/collect.c b/collect.c index a84bd71a..afdaa25f 100644 --- a/collect.c +++ b/collect.c @@ -356,9 +356,8 @@ add_attachment(struct attachment *attach, char *file, int expand_file) struct attachment *ap, *nap; if (expand_file) { - file = file_expand(file); - if (file == NULL) - return NULL; + if ((file = file_expand(file)) == NULL) + return (NULL); } else file = savestr(file); if (access(file, R_OK) != 0) @@ -737,18 +736,18 @@ jcont: while (whitechar(*cp)) cp++; if (*cp == '\0') { - printf(tr(57, "Interpolate what file?\n")); + fprintf(stderr, tr(57, + "Interpolate what file?\n")); break; } if (*cp == '!') { insertcommand(collf, cp + 1); break; } - cp = file_expand(cp); - if (cp == NULL) + if ((cp = file_expand(cp)) == NULL) break; if (is_dir(cp)) { - printf(tr(58, "%s: Directory\n"), cp); + fprintf(stderr, tr(58, "%s: Directory\n"), cp); break; } if ((fbuf = Fopen(cp, "r")) == NULL) { -- 2.11.4.GIT