summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/netrc.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-03-10 12:24:13 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-03-10 12:24:13 +0100
commit69c2ecbdc937e3c73fe67d3c9bce12a80d3ec7ec (patch)
treeb3b8f0753ebe2760ab8d97b0e9404ddbeef25a1b /apt-pkg/contrib/netrc.cc
parentfd6a8d0ddc14406bb6c0996b5bbaa95d6ccc1186 (diff)
various simple changes to fix cppcheck warnings
Diffstat (limited to 'apt-pkg/contrib/netrc.cc')
-rw-r--r--apt-pkg/contrib/netrc.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc
index 0a902f126..de95aa4ab 100644
--- a/apt-pkg/contrib/netrc.cc
+++ b/apt-pkg/contrib/netrc.cc
@@ -50,14 +50,10 @@ static int parsenetrc_string (char *host, std::string &login, std::string &passw
FILE *file;
int retcode = 1;
int specific_login = (login.empty() == false);
- char *home = NULL;
bool netrc_alloc = false;
- int state_our_login = false; /* With specific_login,
- found *our* login name */
-
if (!netrcfile) {
- home = getenv ("HOME"); /* portable environment reader */
+ char const * home = getenv ("HOME"); /* portable environment reader */
if (!home) {
struct passwd *pw;
@@ -86,6 +82,8 @@ static int parsenetrc_string (char *host, std::string &login, std::string &passw
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 */
while (!done && getline(&netrcbuffer, &netrcbuffer_size, file) != -1) {
tok = strtok_r (netrcbuffer, " \t\n", &tok_buf);