1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-10 07:38:06 -05:00

Turn a rogue malloc to smalloc

[originally from svn r840]
This commit is contained in:
Simon Tatham 2001-01-07 15:27:19 +00:00
parent 5a908bb1d7
commit fc478e6cad

2
scp.c
View File

@ -459,7 +459,7 @@ static void do_cmd(char *host, char *user, char *cmd)
namelen = 0;
if (GetUserName(user, &namelen) == FALSE)
bump("Empty user name");
user = malloc(namelen * sizeof(char));
user = smalloc(namelen * sizeof(char));
GetUserName(user, &namelen);
if (verbose) tell_user(stderr, "Guessing user name: %s", user);
strncpy(cfg.username, user, sizeof(cfg.username)-1);