public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: Theodore Tso <tytso@mit.edu>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfstests: fix up fs_perms test used by 126
Date: Mon, 08 Feb 2010 13:47:16 -0600	[thread overview]
Message-ID: <4B706A44.4000804@sandeen.net> (raw)
In-Reply-To: <20100208194058.GC9527@infradead.org>

Christoph Hellwig wrote:
> On Fri, Feb 05, 2010 at 10:59:45AM -0600, Eric Sandeen wrote:
>> @@ -53,7 +53,8 @@ int main( int argc, char *argv[]) {
>>                cgroupId = atoi(argv[3]);
>>                userId = atoi(argv[4]);
>>                groupId = atoi(argv[5]);
>> -              fperm[0] = *argv[6];
>> +              strncpy(fperm, argv[6], 3);
>> +              fperm[2] = '\0';
> 
> This still looks rather weird to me.  What's the reason for copying
> the string into a fixed length buffer?  Why not leave fperm as a pointer
> to the original argument?

eh that's probably better, I guess I was just thinking copy
based on how it was before.  (which copied the char, right, it
didn't assign a pointer, unless I'm short on coffee today...)

OTOH fopen only takes 2 chars anyway.  But probably no reason to
truncate what was given, just fail if it's something that's wrong...

-Eric
 
> The rest of the patch looks fine, but a clean up pass on the whole
> file wouldn't hurt either, it's a grotty mess..
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-02-08 19:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05 16:59 [PATCH] xfstests: fix up fs_perms test used by 126 Eric Sandeen
2010-02-08 19:40 ` Christoph Hellwig
2010-02-08 19:47   ` Eric Sandeen [this message]
2010-02-09 16:54   ` [PATCH V2] " Eric Sandeen
2010-02-09 17:53     ` Christoph Hellwig

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=4B706A44.4000804@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=hch@infradead.org \
    --cc=tytso@mit.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox