### zulkan's blog

By zulkan, 9 years ago,

I have this code http://ideone.com/aAhXE8

but in cf (custom test) it has different output http://s16.postimg.org/hug6l6y4l/bug.jpg

why is the newline character still entering the loop ?

in my computer the output is like the one in ideone, is it a bug in CF ?

edit : answered, CF is using : ~~~~~ "\r\n" ~~~~~

• -2

 » 9 years ago, # |   +8 I think, it's better to write like this while ((c = (char)br.read()) && c >= '0' && c <= '9') (Sorry for my poor english)
•  » » 9 years ago, # ^ |   -6 maybe you meant while ( (c=(char)br.read())>='0' && c <='9)because (c = (char)br.read()) isn't a condition, but, now i know that for new line, CF use "\r\n"
 » 9 years ago, # |   +26 You can fix it if you add && c != '\r' into if condition. It happend because of difference between newline representation by Linux and Windows. http://en.wikipedia.org/wiki/Newline#Representations
•  » » 9 years ago, # ^ |   0 thx, i didn't know that