Skip to content

Conversation

aldian
Copy link

@aldian aldian commented Sep 13, 2020

My Linux system won't allow me to use gets function as probably it is not safe, so I have to use fgets:

 error: ‘gets’ was not declared in this scope
       scanf("%d ", &d); gets(line); 
                         ^~~~

So using fgets is good for compatibility. However, fgets includes newline to the result,
so without this simple fix, the code will loop forever as 4 strcmps at line 49-55 won't match.

@aldian aldian force-pushed the fix-line-reading-and-checking branch from df20700 to 362eb07 Compare September 13, 2020 15:39
@Jakester78
Copy link

Merge pls

Copy link

@Jakester78 Jakester78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants