Skip to content

Commit

Permalink
console.c (FindCompletion): silence stupid -Wstringop-truncation from…
Browse files Browse the repository at this point in the history
… gcc-14

console.c: In function 'FindCompletion':
console.c:859:33: warning: '__builtin_strncpy' output may be truncated copying 31 bytes from a string of length 31 [-Wstringop-truncation]
  859 |                                 strncpy (matched, file->name, sizeof(matched)-1);
      |                                 ^~~~~~~
  • Loading branch information
sezero committed Jun 4, 2024
1 parent 83617f4 commit 814e932
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Quake/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ FindCompletion -- stevenaaus
*/
const char *FindCompletion (const char *partial, filelist_item_t *filelist, int *nummatches_out)
{
static char matched[32];
static char matched[40];
char *i_matched, *i_name;
filelist_item_t *file;
int init, match, plen;
Expand Down

0 comments on commit 814e932

Please sign in to comment.