X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/6df3c104f2ee9429bef67134ec0eedd5cd26cc08..4e63d9b2c5c8b25ee4fe5fa7505bfbf6d72644f1:/psftp.c diff --git a/psftp.c b/psftp.c index 482d66ee..ef930bdd 100644 --- a/psftp.c +++ b/psftp.c @@ -2287,10 +2287,13 @@ struct sftp_command *sftp_getcmd(FILE *fp, int mode, int modeflags) * >this has "quotes" in< * >and"this"< */ - while (*p) { + while (1) { /* skip whitespace */ while (*p && (*p == ' ' || *p == '\t')) p++; + /* terminate loop */ + if (!*p) + break; /* mark start of word */ q = r = p; /* q sits at start, r writes word */ quoting = 0;