LoRd_MuldeR
2nd June 2016, 19:04
Okay, so I'm running this, expecting that the dir command would pass all file names in the current directory to my program stdindmp, one per line:
chcp 65001
dir /b | stdindmp.exe
My program simply reads all lines from the STDIN, using fgetws(), and then writes them back to STDERR. So, the expected output would be that my program writes all file names to the console, one per line.
This does work, most of the times. However, every now and then, some line breaks disappear miraculously, resulting in wrong output! :eek: :scared:
[...]
``Doom3_294.jpg创
``Doom3_295.jpg创
``Doom3_296.jpgDoom3_297.jpg创
File ``E:\PiCz\sCrEeNsHoTz\Doom3_296.jpgDoom3_297.jpg创 not found!
``Doom3_298.jpg创
``Doom3_299.jpg创
``Doom3_300.jpg创
[...]
Any idea what the heck is going on here? :confused:
(code attached)
chcp 65001
dir /b | stdindmp.exe
My program simply reads all lines from the STDIN, using fgetws(), and then writes them back to STDERR. So, the expected output would be that my program writes all file names to the console, one per line.
This does work, most of the times. However, every now and then, some line breaks disappear miraculously, resulting in wrong output! :eek: :scared:
[...]
``Doom3_294.jpg创
``Doom3_295.jpg创
``Doom3_296.jpgDoom3_297.jpg创
File ``E:\PiCz\sCrEeNsHoTz\Doom3_296.jpgDoom3_297.jpg创 not found!
``Doom3_298.jpg创
``Doom3_299.jpg创
``Doom3_300.jpg创
[...]
Any idea what the heck is going on here? :confused:
(code attached)