Skip to content

Commit

Permalink
Reduce variable scope - imap/util.c
Browse files Browse the repository at this point in the history
  • Loading branch information
fekir authored and flatcap committed Mar 3, 2018
1 parent 72fe41b commit 1efa6c7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions imap/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit 1efa6c7

Please sign in to comment.