Re: sscanf in conditional - what should happen?
Chris Angelico <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CAPTjJmrKfFPqnuhFwUR5Hax02N7+fHyfegXrC58ORpcwtUToAQ@mail.gmail.com> |
On Sun, Jan 18, 2015 at 11:40 PM, Arne Goedeke <[email protected]> wrote: > Yes, it ought to be undefined. Can you produce a testcase? This is about as minimal as I can get it. int main() { string ext=".rar"; { string foo="oops!"; //This ends up in x } if (ext==".rar" || sscanf(ext,".r%d",int x)) write("x should be an integer, is actually %O\n",x); } On a current Pike 8.1, this has "oops!" in x. Likewise in 7.8.866 on Windows. ChrisA