From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfstests: memset proper length in resvtest.c
Date: Tue, 4 Mar 2014 10:36:55 -0500 [thread overview]
Message-ID: <20140304153655.GC51235@bfoster.bfoster> (raw)
In-Reply-To: <531563D8.2070007@redhat.com>
On Mon, Mar 03, 2014 at 11:25:44PM -0600, Eric Sandeen wrote:
> sizeof(pointer) is not very relevant; sizeof(*pointer)
> is a bit more so.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> diff --git a/src/resvtest.c b/src/resvtest.c
> index 037d9ea..a07f503 100644
> --- a/src/resvtest.c
> +++ b/src/resvtest.c
> @@ -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
> unlink(filename);
> writefd = open(filename, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-03-04 15:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 5:25 [PATCH] xfstests: memset proper length in resvtest.c Eric Sandeen
2014-03-04 15:36 ` Brian Foster [this message]
2014-03-04 16:49 ` Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140304153655.GC51235@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=sandeen@redhat.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.