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

Re: svn commit: r31622 - trunk/subversion/libsvn_repos

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: Tue, 10 Jun 2008 13:14:22 +0530

-----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

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.