xfstests: memset proper length in resvtest.c
PATCH 1/1 xfstests: memset proper length in resvtest.c
sizeof(pointer) is not very relevant; sizeof(*pointer) is a bit more so.
---
src/resvtest.c +1 -1
@@ -73,7 +73,7 @@ main(int argc, char **argv)perror ("open" );exit (1 ); } -memset (writebuffer,'A' ,sizeof (writebuffer)); +memset (writebuffer,'A' ,sizeof (*writebuffer));unlink (filename); writefd =open (filename,O_RDWR |O_CREAT |O_EXCL ,S_IRUSR |S_IWUSR );
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 11 lines · Eric Sandeen
sizeof(pointer) is not very relevant;
sizeof(*pointer)is a bit more so.Signed-off-by Eric Sandeen <[email protected]>---
src/resvtest.c +0
-0
src/resvtest.c main(int argc, char **argv) · line 77
Quoted 6 lines
src/resvtest.c +1
-1@@ -73,7 +73,7 @@ main(int argc, char **argv)perror ("open" );exit (1 ); } -memset (writebuffer,'A' ,sizeof (writebuffer)); +memset (writebuffer,'A' ,sizeof (*writebuffer));
It's not clear to me how much this is intending to write/read. If the entire buffer, we should probably use the buffer size. sizeof(*writebuffer) is a single byte, no?
Also, there are other instances of the same thing throughout this file. I think they need to be consistent, in any event, for the test to work.
Brian
Quoted 7 lines
src/resvtest.c +0
-0unlink (filename); writefd =open (filename,O_RDWR |O_CREAT |O_EXCL ,S_IRUSR |S_IWUSR );_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 23 lines · Brian Foster
Quoted 11 lines · Eric Sandeen
sizeof(pointer) is not very relevant;
sizeof(*pointer)is a bit more so.Signed-off-by Eric Sandeen <[email protected]>---
src/resvtest.c +0
-0src/resvtest.c main(int argc, char **argv) · line 77
Quoted 6 lines
src/resvtest.c +1
-1@@ -73,7 +73,7 @@ main(int argc, char **argv)perror ("open" );exit (1 ); } -memset (writebuffer,'A' ,sizeof (writebuffer)); +memset (writebuffer,'A' ,sizeof (*writebuffer));It's not clear to me how much this is intending to write/read. If the entire buffer, we should probably use the buffer size.
sizeof(*writebuffer)is a single byte, no?
Quoted 2 lines
Also, there are other instances of the same thing throughout this file. I think they need to be consistent, in any event, for the test to work.
yeah, sorry, I was in a bit too much of a rush; just disregard this for now I guess. too-quick reaction to a gcc compile warning.
-Eric
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs