`ampersat-in-username': tweak `strchr' to `strrchr' where necessary to
[u/mdw/putty] / psftp.c
diff --git a/psftp.c b/psftp.c
index e5374c5..ba038b0 100644 (file)
--- 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) {