Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation issue #36

Closed
mschmitt3459 opened this issue Dec 22, 2019 · 2 comments
Closed

Compilation issue #36

mschmitt3459 opened this issue Dec 22, 2019 · 2 comments

Comments

@mschmitt3459
Copy link

Howdy,

I'm trying to compile mcrcon, the latest version, and am getting the following error:

cc -std=gnu99 -Wall -Wextra -Wpedantic -Os -s -fstack-protector-strong -o mcrcon mcrcon.c
mcrcon.c: In function ‘get_line’:
mcrcon.c:752:2: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
(void) fgets(buffer, bsize, stdin);

Can you help me out?

Thanks.

@Tiiffi
Copy link
Owner

Tiiffi commented Dec 22, 2019

Hi,

This is the same issue described here: #17

It's just a warning about ignoring return value of fgets() function.

You can either ignore the warning (should be okay) or download and build Develop branch which has this issue fixed.

Or if you want to patch it yoursef, you could replace line:

mcrcon/mcrcon.c

Line 752 in 8fdda29

(void) fgets(buffer, bsize, stdin);

with the fix from Develop branch:

mcrcon/mcrcon.c

Lines 688 to 690 in af5e88b

char *ret = fgets(buffer, bsize, stdin);
if (ret == NULL)
exit(EXIT_FAILURE);

@mschmitt3459
Copy link
Author

mschmitt3459 commented Dec 22, 2019 via email

@Tiiffi Tiiffi closed this as completed Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants