Changeset 47d4f8c for tools/tracesplit


Ignore:
Timestamp:
06/27/18 18:01:48 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, master, rc-4.0.4, ringdecrementfix, ringperformance
Children:
1ed69dc
Parents:
35de364
Message:

Fix various string truncation/overflow warnings

Thanks gcc 8!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracesplit/tracesplit.c

    r92cf299 r47d4f8c  
    6161static char *strdupcat(char *str,char *app)
    6262{
    63         str=realloc(str,strlen(str)+strlen(app)+1);
    64         strncat(str,app,strlen(str) + strlen(app));
     63        int newsize = strlen(str)+strlen(app)+1;
     64        str=realloc(str,newsize);
     65        strncat(str,app,newsize - strlen(str) - 1);
    6566        return str;
    6667}
Note: See TracChangeset for help on using the changeset viewer.