mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Fix guard against returning a zero hash.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19232 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4ef8c6aeb4
commit
46e30f1fd0
3 changed files with 9 additions and 9 deletions
|
@ -1184,7 +1184,7 @@ getCString_u(ivars self, char *buffer, unsigned int maxLength,
|
|||
can't deal with our leftoverRange case, so we need to use a bit of
|
||||
complexity instead. */
|
||||
unsigned int len;
|
||||
|
||||
|
||||
/* TODO: this is an extremely ugly hack to work around buggy iconvs
|
||||
that return -1/E2BIG for buffers larger than 0x40000acf */
|
||||
if (maxLength > 0x40000000)
|
||||
|
@ -3831,14 +3831,11 @@ agree, create a new GSUnicodeInlineString otherwise.
|
|||
* The hash caching in our concrete string classes uses zero to denote
|
||||
* an empty cache value, so we MUST NOT return a hash of zero.
|
||||
*/
|
||||
ret &= 0x0fffffff;
|
||||
if (ret == 0)
|
||||
{
|
||||
ret = 0x0fffffff;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret &= 0x0fffffff;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue