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
69d31f5704
commit
92b35443e6
3 changed files with 9 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-05-03 22:12 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSString.m (-hash),
|
||||
Source/GSString.m ([NSConstantString -hash]): Fix guard against
|
||||
returning a zero hash.
|
||||
|
||||
2004-04-29 23:00 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* configure.ac: Test for iconv support by compiling a program that
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -2193,14 +2193,11 @@ handle_printf_atsign (FILE *stream,
|
|||
* 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;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue