From: Federico Kircheis Date: Tue, 6 Mar 2018 20:06:08 +0000 (+0100) Subject: Reduce variable scope - safe_asprintf.c X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e4e1d93c50316caf3499d84a81c47f4e93cef6b;p=neomutt Reduce variable scope - safe_asprintf.c --- diff --git a/safe_asprintf.c b/safe_asprintf.c index 682d1a938..756ade6bb 100644 --- a/safe_asprintf.c +++ b/safe_asprintf.c @@ -68,14 +68,13 @@ int safe_asprintf(char **strp, const char *fmt, ...) int safe_asprintf(char **strp, const char *fmt, ...) { int rlen = STRING; - int n; *strp = mutt_mem_malloc(rlen); while (true) { va_list ap; va_start(ap, fmt); - n = vsnprintf(*strp, rlen, fmt, ap); + const int n = vsnprintf(*strp, rlen, fmt, ap); va_end(ap); if (n < 0) {