replace sprintf all over the place
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1635 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -79,7 +79,7 @@ ruserpass(char *host, char **aname, char **apass, char **aacct)
|
||||
hdir = getenv("HOME");
|
||||
if (hdir == NULL)
|
||||
hdir = ".";
|
||||
sprintf(buf, "%s/.netrc", hdir);
|
||||
snprintf(buf, sizeof(buf), "%s/.netrc", hdir);
|
||||
cfile = fopen(buf, "r");
|
||||
if (cfile == NULL) {
|
||||
if (errno != ENOENT)
|
||||
@@ -127,8 +127,7 @@ next:
|
||||
case LOGIN:
|
||||
if (token())
|
||||
if (*aname == 0) {
|
||||
*aname = malloc((unsigned) strlen(tokval) + 1);
|
||||
strcpy(*aname, tokval);
|
||||
*aname = strdup(tokval);
|
||||
} else {
|
||||
if (strcmp(*aname, tokval))
|
||||
goto next;
|
||||
@@ -143,8 +142,7 @@ next:
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *apass == 0) {
|
||||
*apass = malloc((unsigned) strlen(tokval) + 1);
|
||||
strcpy(*apass, tokval);
|
||||
*apass = strdup(tokval);
|
||||
}
|
||||
break;
|
||||
case ACCOUNT:
|
||||
@@ -155,8 +153,7 @@ next:
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *aacct == 0) {
|
||||
*aacct = malloc((unsigned) strlen(tokval) + 1);
|
||||
strcpy(*aacct, tokval);
|
||||
*aacct = strdup(tokval);
|
||||
}
|
||||
break;
|
||||
case MACDEF:
|
||||
|
||||
Reference in New Issue
Block a user