]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
Fix warning strncpy bound equals destination size
authorWolfgang Stöggl <c72578@yahoo.de>
Fri, 14 Dec 2018 11:11:05 +0000 (12:11 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Fri, 14 Dec 2018 12:38:24 +0000 (13:38 +0100)
commit61f52e00a6603d49b100108426283aa1992aafd7
treea93fcb0cf0fe7a544bd0d0b14718ec5843ee547c
parentd5640bef72434947ea4caa0b59c870c9b9f6988e
Fix warning strncpy bound equals destination size

- Reduce num from 5 to 4 in strncpy and add null terminator.
  Remark: Version strings consist of 4 chars, e.g. RRD_VERSION5 "0005"

- Fixes the following GCC 8 warnings:
  rrd_create.c:960:9: warning:
    ‘strncpy’ specified bound 5 equals destination size
    [-Wstringop-truncation]
    strncpy(rrd.stat_head->version, require_version, 5);

  rrd_modify.c:1218:9: warning:
    ‘strncpy’ specified bound 5 equals destination size
    [-Wstringop-truncation]
    strncpy(out->stat_head->version, require_version, 5);
src/rrd_create.c
src/rrd_modify.c