Fixed compiler bug

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);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This commit is contained in:
Addison G
2020-08-12 14:10:58 +10:00
committed by GitHub
parent b02201d689
commit 336f528668

View File

@ -573,7 +573,7 @@ rc_packet *packet_build(int id, int cmd, char *s1)
packet.size = sizeof(int) * 2 + s1_len + 2;
packet.id = id;
packet.cmd = cmd;
strncpy(packet.data, s1, DATA_BUFFSIZE);
strncpy(packet.data, s1, DATA_BUFFSIZE - 1);
return &packet;
}