You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2013/05/22 18:51:55 UTC
Re: svn commit: r1485007 - /subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/ io.c
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