Bump username storage from 32 to 100 chars. Also replaced a couple of magic
numbers with sizeof in ssh.c.
I don't believe this is going to startle any of the protocols PuTTY talks.
git-svn-id: svn://svn.tartarus.org/sgt/putty@1952
cda61777-01e9-0310-a592-
d414129be87e
char termtype[32];
char termspeed[32];
char environmt[1024]; /* VAR\tvalue\0VAR\tvalue\0\0 */
char termtype[32];
char termspeed[32];
char environmt[1024]; /* VAR\tvalue\0VAR\tvalue\0\0 */
- char username[32];
- char localusername[32];
+ char username[100];
+ char localusername[100];
int rfc_environ;
int passive_telnet;
/* Keyboard options */
int rfc_environ;
int passive_telnet;
/* Keyboard options */
c_write_str("\r\n");
}
} else {
c_write_str("\r\n");
}
} else {
- strncpy(username, cfg.username, 99);
- username[99] = '\0';
+ strncpy(username, cfg.username, sizeof(username));
+ username[sizeof(username)-1] = '\0';
}
send_packet(SSH1_CMSG_USER, PKT_STR, username, PKT_END);
}
send_packet(SSH1_CMSG_USER, PKT_STR, username, PKT_END);
username[strcspn(username, "\n\r")] = '\0';
} else {
char stuff[200];
username[strcspn(username, "\n\r")] = '\0';
} else {
char stuff[200];
- strncpy(username, cfg.username, 99);
- username[99] = '\0';
+ strncpy(username, cfg.username, sizeof(username));
+ username[sizeof(username)-1] = '\0';
if ((flags & FLAG_VERBOSE) || (flags & FLAG_INTERACTIVE)) {
sprintf(stuff, "Using username \"%s\".\r\n", username);
c_write_str(stuff);
if ((flags & FLAG_VERBOSE) || (flags & FLAG_INTERACTIVE)) {
sprintf(stuff, "Using username \"%s\".\r\n", username);
c_write_str(stuff);