On Mon, Dec 1, 2014 at 9:44 AM, Duy Nguyen <pclo...@gmail.com> wrote:
> On Sun, Nov 30, 2014 at 9:41 AM, David Michael <fedora....@gmail.com> wrote:
>> +int git_stat(const char *path, struct stat *buf)
>> +{
>> +       int rc;
>> +       rc = stat(path, buf);
>> +       if (buf != NULL)
>
> It's a minor thing, but maybe test "!rc" instead of "buf != NULL"?

Okay, it makes sense to only do the conversion for a successful return code.

Should it test for both a zero return code and a non-null pointer?  I
don't know if there are any cases where passing a null pointer is
legal.  The standard doesn't seem to explicitly forbid it.  z/OS
returns -1 and sets errno to EFAULT when stat() is given NULL, but
this patch should be able to be used on any platform.

David
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to