[C-prog-lang-l] Testing input issue

Jura Pelc jirik.pelc1998 at gmail.com
Wed Jun 5 23:13:26 CEST 2019


Hi,
I finished coding Ed Phase 1. I thing (I hope) I have done everything
according to task. Today I want to start testing and found one issue. The
first test ended in infinite loop. I found, then the application infinitely
reading input a executing it.
When the same input is used in running application it is fine.

I have these construct to gen input
                fgets(str, MAX_COMMAND_LENGTH + 1, stdin);
And command is:
                1p
I let app to print me chars and in both situations it is 49, 112, 10
So newline char is here and fgets should stop at new line

So my question is: *What is difference between standard input directly from
console and send by pipe?*


-- 

S pozdravem Jiří Pelc
Matematicko-fyzikální fakulta
Univerzita Karlova
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the c-prog-lang-l mailing list