diff options
| author | Ravishankar N <ravishankar@redhat.com> | 2018-08-15 19:34:31 +0530 | 
|---|---|---|
| committer | Amar Tumballi <amarts@redhat.com> | 2018-08-21 10:50:21 +0000 | 
| commit | cb210f83455e2f659e734dfa09ff7602b5b75201 (patch) | |
| tree | e355b6545f3d029d7fbd9cc3910bd347a89e567c /libglusterfs | |
| parent | 6fa531c57c633827283fba6a3cdaa1c68976ccb7 (diff) | |
glusterd: fix gcc warnings
...and also changed char array initialization to from {0,} to "".
gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC) on Fedora 28.
Sample warnings:
glusterd-utils.c:7234:41: warning: ‘.hostname’ directive output may be truncated writing 9 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
         snprintf (key, sizeof (key), "%s.hostname", base_key);
                                         ^~~~~~~~~
glusterd-utils.c:7234:9: note: ‘snprintf’ output between 10 and 1033 bytes into a destination of size 1024
         snprintf (key, sizeof (key), "%s.hostname", base_key);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glusterd-snapshot.c:3090:65: warning: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4095 [-Wformat-truncation=]
                 snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s",
                                                                 ^
glusterd-snapshot.c:3090:17: note: ‘snprintf’ output between 2 and 4351 bytes into a destination of size 4095
                 snprintf (snap_path, sizeof (snap_path) - 1, "%s/%s",
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                           snap_mount_dir, snap_vol->snapshot->snapname);
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glusterd-statedump.c:28:45: warning: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 144 [-Wformat-truncation=]
         snprintf (subkey, sizeof (subkey), "%s%d", key, index);
                                             ^~     ~~~
glusterd-statedump.c:28:9: note: ‘snprintf’ output between 2 and 4107 bytes into a destination of size 144
         snprintf (subkey, sizeof (subkey), "%s%d", key, index);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
updates: bz#1193929
Change-Id: Ic721f27b28d1221c124b570e81c55528f5b7f3cd
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'libglusterfs')
0 files changed, 0 insertions, 0 deletions
