From: Jacob Nevins Date: Tue, 21 Sep 2004 16:49:51 +0000 (+0000) Subject: `ampersat-in-username': tweak `strchr' to `strrchr' where necessary to X-Git-Tag: r8855-g4f798d~1085 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=8d7d10b8c707a082d440b336391496e01d039664;p=PuTTY_svn.git `ampersat-in-username': tweak `strchr' to `strrchr' where necessary to consistently support usernames containing `@'. git-svn-id: http://svn.tartarus.org/sgt/putty@4563 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/plink.c b/plink.c index 307d7298..f6e2a702 100644 --- a/plink.c +++ b/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) { diff --git a/psftp.c b/psftp.c index e5374c5f..ba038b07 100644 --- a/psftp.c +++ b/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) { diff --git a/scp.c b/scp.c index fe341be1..1c601e97 100644 --- a/scp.c +++ b/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) { diff --git a/unix/uxplink.c b/unix/uxplink.c index ee446ece..d144cb9f 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -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) { diff --git a/window.c b/window.c index 762df68a..39ac38dc 100644 --- a/window.c +++ b/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) {