]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
fstests: fstest.c, fix compile warnings replace sprintf with snprintf
authorAnand Jain <anand.jain@oracle.com>
Sun, 29 Jan 2023 02:42:31 +0000 (10:42 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 3 Feb 2023 18:06:30 +0000 (02:06 +0800)
commit8d8d05a8e222658931310f55dfbe65edd8e80932
tree261e24188de58f320a5e30b1eb658c973073285d
parent7fa8a9a25bd1415c67e7bf0ed6c02727ba94fc40
fstests: fstest.c, fix compile warnings replace sprintf with snprintf

Fixes the buffer overflow warnings, by using snprintf instead of
sprintf.

fstest.c:95:20: warning: '/file' directive writing 5 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
  sprintf(fname, "%s/file%d", dir, fnum);
                    ^~~~~
fstest.c:166:20: warning: '/file' directive writing 5 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
  sprintf(fname, "%s/file%d", dir, fnum);

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/fstest.c