[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1485007 - /subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/ io.c

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 22 May 2013 17:51:55 +0100 (BST)

Daniel Shahaf wrote:
> Bert Huijben wrote on Wed, May 22, 2013 at 10:50:17 +0200:
>>>    failed_command = apr_pstrcat(pool, failed_command, cmd[i]);
>>>    failed_command = apr_pstrcat(pool, failed_command, " ");
>>
>> Note that apr_pstrcat needs a final NULL argument :)
>>
>> So you could use apr_pstrcat(pool, failed_command, " ", cmd[i], NULL);
>
> You need to explicitly cast the last NULL:
>
>     apr_pstrcat(pool, failed_command, " ", cmd[i], (void *)NULL);
>
> (because it's a variadic function so there is no implicit conversion to
> a pointer, when NULL is #define'd to be a 0 narrower than the pointer)

For a strcat, the arguments are pointers to 'char', so it looks better to use (char *)NULL.

- Julian
Received on 2013-05-22 18:52:51 CEST

This is an archived mail posted to the Subversion Dev mailing list.