-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Senthil,
- - capabilities_string = "";
+ strcpy(capabilities_string, "");
You can not copy to such un-initialized location.
May the fix could be
- - capabilities_string = "";
+ capabilities_string = apr_pstrdup(pool, "");
With regards
Kamesh Jayachandran
Senthil Kumaran S wrote:
> Hi Daniel,
>
> danielsh_at_tigris.org wrote:
>> + if (capabilities)
>> + {
>> + capabilities_string = svn_cstring_join(capabilities, ":",
>> pool);
>> +
>> + /* Get rid of that annoying final colon. */
>> + if (capabilities_string[0])
>> + capabilities_string[strlen(capabilities_string) - 1] = '\0';
>> + }
>> + else
>> + {
>> + capabilities_string = "";
>> + }
>
> We cannot assign a string constant directly like that. A good compiler
> will give the following.
>
> <snip>
> ../subversion/libsvn_repos/hooks.c: In function
> 'svn_repos__hooks_start_commit':
> ../subversion/libsvn_repos/hooks.c:579: warning: assignment discards
> qualifiers from pointer target type
> </snip>
>
> My compiler version is:
> gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
> Copyright (C) 2006 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> The attached patch fixes this :)
>
> [[[
> Fix a compiler warning.
>
> * subversion/libsvn_repos/hooks.c
> (svn_repos__hooks_start_commit): Fix a compiler warning of 'assignment
> discards qualifiers from pointer target type'.
>
> Patch by: stylesen
> ]]]
>
> Thank You.
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFITjDW3WHvyO0YTCwRAgo4AJ48L3gGui+JTa+pIeG/7Zg7mof4bACggDk9
cwrxDyCn7uJnhye39/tbq5E=
=x0DD
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-10 09:45:07 CEST