]> git.ipfire.org Git - thirdparty/util-linux.git/commit
misc: fix gcc-7 sprintf warnings -Wformat-overflow
authorRuediger Meier <ruediger.meier@ga-group.nl>
Sun, 11 Jun 2017 20:20:24 +0000 (22:20 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 14 Jun 2017 09:48:22 +0000 (11:48 +0200)
commitf64ddc95f39f2cb5cc5b41748754ecbe81cfa7dd
treeb1b34bdccf33999c8b5b27b9a7b823cad43ecedb
parent39ff5b34d3274a02526a1226fdd8845c95bbc823
misc: fix gcc-7 sprintf warnings -Wformat-overflow

../login-utils/last.c: In function ‘main’:
../login-utils/last.c:624:23: warning: ‘%s’ directive writing up to 31 bytes into a region of size 27 [-Wformat-overflow=]
   sprintf(path, "/dev/%s", ut->ut_line);
                       ^~   ~~
../login-utils/last.c:624:3: note: ‘sprintf’ output between 6 and 37 bytes into a destination of size 32
   sprintf(path, "/dev/%s", ut->ut_line);

../libblkid/src/devname.c: In function 'probe_one':
../libblkid/src/devname.c:166:29: warning: '%s' directive writing up to 255 bytes into a region of size 245 [-Wformat-overflow=]
   sprintf(path, "/sys/block/%s/slaves", de->d_name);
                             ^~
../libblkid/src/devname.c:166:3: note: 'sprintf' output between 19 and 274 bytes into a destination of size 256
   sprintf(path, "/sys/block/%s/slaves", de->d_name);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
libblkid/src/devname.c
login-utils/last.c