X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a0e07f3ec885c12c733c12805391646c202f3f31..4e1c86a6c0cf9a6e51ec4f9b9ad9271547fa036d:/apt-pkg/contrib/netrc.cc diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index b9d0749e2..56e59d84b 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -14,7 +14,9 @@ #include #include +#include #include + #include #include #include @@ -24,6 +26,7 @@ #include "netrc.h" +using std::string; /* Get user and password from .netrc when given a machine name */ @@ -65,8 +68,7 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) if (!home) return -1; - asprintf (&netrcfile, "%s%s%s", home, DIR_CHAR, NETRC); - if(!netrcfile) + if (asprintf (&netrcfile, "%s%s%s", home, DIR_CHAR, NETRC) == -1 || netrcfile == NULL) return -1; else netrc_alloc = true;