|
From: Jason F. <ja...@gl...> - 2002-04-30 22:30:36
|
Hey all I'm trying to track down a bug in gets (in msvcrt). Here's the problem, = based on the calls made: 1: gets calls getchar to get each character, checking for \n or EOF 2: getchar calls getc, using STDIN as the file handle 3: getc calls _filbuf, again passing the file handle (STDIN) 4: _filbuf calls _read 5: _read calls ReadFile 6: ReadFile calls ReadConsoleA because IsConsoleHandle returns true ReadConsoleA gets a series of characters from the keyboard and only = returns when it gets a \n. So in effect, getchar is getting an entire = string from the console instead of a single character. At which point is the fault? Should ReadFile call ReadConsoleA? Or = perhaps is the fault in calling _filbuf? I don't know... I really need = some advice on this. Thanks!! - Jason |