From 1efa6c7586d008bc761ca36fa9756bd5117a53c3 Mon Sep 17 00:00:00 2001 From: Federico Kircheis Date: Sat, 3 Mar 2018 09:35:42 +0100 Subject: [PATCH] Reduce variable scope - imap/util.c --- imap/util.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/imap/util.c b/imap/util.c index cb1d86b696f..4e35df2bfc6 100644 --- a/imap/util.c +++ b/imap/util.c @@ -382,10 +382,8 @@ int imap_parse_path(const char *path, struct ImapMbox *mx) static unsigned short ImapPort = 0; static unsigned short ImapsPort = 0; struct servent *service = NULL; - char tmp[128]; struct Url url; char *c = NULL; - int n; if (!ImapPort) { @@ -435,6 +433,7 @@ int imap_parse_path(const char *path, struct ImapMbox *mx) { url_free(&url); FREE(&c); + char tmp[128]; if (sscanf(path, "{%127[^}]}", tmp) != 1) return -1; @@ -454,7 +453,7 @@ int imap_parse_path(const char *path, struct ImapMbox *mx) mx->account.flags |= MUTT_ACCT_USER; } - n = sscanf(tmp, "%127[^:/]%127s", mx->account.host, tmp); + const int n = sscanf(tmp, "%127[^:/]%127s", mx->account.host, tmp); if (n < 1) { mutt_debug(1, "NULL host in %s\n", path);