Skip to content

Fixed compiler error#53

Merged
Tiiffi merged 1 commit intoTiiffi:developfrom
AddisonG:master
Feb 12, 2021
Merged

Fixed compiler error#53
Tiiffi merged 1 commit intoTiiffi:developfrom
AddisonG:master

Conversation

@AddisonG
Copy link
Copy Markdown
Contributor

This fixes the compiler error that is thrown when compiling with: gcc -std=gnu11 -pedantic -Wall -Wextra -O2 -s -o mcrcon mcrcon.c.

This would never have been an issue, because of the check on line 568, but the compiler still complains. This will make it happy.

mcrcon.c: In function ‘packet_build’:
mcrcon.c:576:2: warning: ‘strncpy’ specified bound 4096 equals destination size [-Wstringop-truncation]
  strncpy(packet.data, s1, DATA_BUFFSIZE);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This fixes the compiler issue:

```
mcrcon.c: In function ‘packet_build’:
mcrcon.c:576:2: warning: ‘strncpy’ specified bound 4096 equals destination size [-Wstringop-truncation]
  strncpy(packet.data, s1, DATA_BUFFSIZE);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
@Tiiffi Tiiffi changed the base branch from master to develop February 12, 2021 02:09
@Tiiffi
Copy link
Copy Markdown
Owner

Tiiffi commented Feb 12, 2021

Will merge into develop branch.

Overall this part of the code seems to be quite wonky and needs more attention.

@Tiiffi Tiiffi merged commit 29a1c99 into Tiiffi:develop Feb 12, 2021
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