diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-12 10:32:05 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-08-12 10:32:05 +0200 |
commit | ea50fdfe2fc21757412baf448b2d41b3ce34b626 (patch) | |
tree | 8910d5504be3cb1952ce33bbabbc0c02a832c735 /apt-pkg/contrib/netrc.cc | |
parent | 851d681d0af7f3346d77738e4708b21ed6e2cc98 (diff) | |
parent | f5a34606b4a910e7b7b984940fb2d12681a2dd3b (diff) |
lots of cppcheck fixes
Diffstat (limited to 'apt-pkg/contrib/netrc.cc')
-rw-r--r-- | apt-pkg/contrib/netrc.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 34f472ee1..9ff5796c5 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -47,10 +47,7 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) int specific_login = (login[0] != 0); char *home = NULL; bool netrc_alloc = false; - int state = NOTHING; - char state_login = 0; /* Found a login keyword */ - char state_password = 0; /* Found a password keyword */ int state_our_login = false; /* With specific_login, found *our* login name */ @@ -81,6 +78,10 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) bool done = false; char netrcbuffer[256]; + int state = NOTHING; + char state_login = 0; /* Found a login keyword */ + char state_password = 0; /* Found a password keyword */ + while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) { tok = strtok_r (netrcbuffer, " \t\n", &tok_buf); while (!done && tok) { |