X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=psftp.c;h=ef930bdd53d7d61cd9fce70d7ce7a0e459eb4cfa;hb=0768c8557d9c4c6297e7bd7a5a114accd51ce546;hp=482d66ee41b94f3274abbda1301ff0c1c9470704;hpb=a580c22c2419a9236466ca8ee80bc97bc9da41eb;p=PuTTY.git 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;