mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fsstress: fix compiler warnings
Fix all the gcc warnings in fsstress, and resize buffers to avoid overflows. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-By: Allison Henderson <allison.henderson@oracle.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
committed by
Eryu Guan
parent
fd532405de
commit
b7b480a0ab
+2
-2
@@ -499,7 +499,7 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (logname) {
|
if (logname) {
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX + NAME_MAX + 1];
|
||||||
snprintf(path, sizeof(path), "%s/%s", rpath, logname);
|
snprintf(path, sizeof(path), "%s/%s", rpath, logname);
|
||||||
if (freopen(path, "a", stdout) == NULL) {
|
if (freopen(path, "a", stdout) == NULL) {
|
||||||
perror("freopen logfile failed");
|
perror("freopen logfile failed");
|
||||||
@@ -583,7 +583,7 @@ int main(int argc, char **argv)
|
|||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
if (logname) {
|
if (logname) {
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX + NAME_MAX + 2 + 11];
|
||||||
snprintf(path, sizeof(path), "%s/%s.%d",
|
snprintf(path, sizeof(path), "%s/%s.%d",
|
||||||
rpath, logname, i);
|
rpath, logname, i);
|
||||||
if (freopen(path, "a", stdout) == NULL) {
|
if (freopen(path, "a", stdout) == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user