mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
ampersat-in-username': tweak
strchr' to `strrchr' where necessary to
consistently support usernames containing `@'. [originally from svn r4563]
This commit is contained in:
parent
90cdc99795
commit
43c4ff62d7
2
plink.c
2
plink.c
@ -484,7 +484,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/* See if host is of the form user@host */
|
||||
if (cfg.host[0] != '\0') {
|
||||
char *atsign = strchr(cfg.host, '@');
|
||||
char *atsign = strrchr(cfg.host, '@');
|
||||
/* Make sure we're not overflowing the user field */
|
||||
if (atsign) {
|
||||
if (atsign - cfg.host < sizeof cfg.username) {
|
||||
|
2
psftp.c
2
psftp.c
@ -1870,7 +1870,7 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
|
||||
|
||||
/* See if host is of the form user@host */
|
||||
if (cfg.host[0] != '\0') {
|
||||
char *atsign = strchr(cfg.host, '@');
|
||||
char *atsign = strrchr(cfg.host, '@');
|
||||
/* Make sure we're not overflowing the user field */
|
||||
if (atsign) {
|
||||
if (atsign - cfg.host < sizeof cfg.username) {
|
||||
|
2
scp.c
2
scp.c
@ -370,7 +370,7 @@ static void do_cmd(char *host, char *user, char *cmd)
|
||||
|
||||
/* See if host is of the form user@host */
|
||||
if (cfg.host[0] != '\0') {
|
||||
char *atsign = strchr(cfg.host, '@');
|
||||
char *atsign = strrchr(cfg.host, '@');
|
||||
/* Make sure we're not overflowing the user field */
|
||||
if (atsign) {
|
||||
if (atsign - cfg.host < sizeof cfg.username) {
|
||||
|
@ -471,7 +471,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/* See if host is of the form user@host */
|
||||
if (cfg.host[0] != '\0') {
|
||||
char *atsign = strchr(cfg.host, '@');
|
||||
char *atsign = strrchr(cfg.host, '@');
|
||||
/* Make sure we're not overflowing the user field */
|
||||
if (atsign) {
|
||||
if (atsign - cfg.host < sizeof cfg.username) {
|
||||
|
2
window.c
2
window.c
@ -525,7 +525,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
|
||||
/* See if host is of the form user@host */
|
||||
if (cfg.host[0] != '\0') {
|
||||
char *atsign = strchr(cfg.host, '@');
|
||||
char *atsign = strrchr(cfg.host, '@');
|
||||
/* Make sure we're not overflowing the user field */
|
||||
if (atsign) {
|
||||
if (atsign - cfg.host < sizeof cfg.username) {
|
||||
|
Loading…
Reference in New Issue
Block a user