mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
|
@ -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>
|
2004-04-29 23:00 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
* configure.ac: Test for iconv support by compiling a program that
|
* 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
|
can't deal with our leftoverRange case, so we need to use a bit of
|
||||||
complexity instead. */
|
complexity instead. */
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
|
||||||
/* TODO: this is an extremely ugly hack to work around buggy iconvs
|
/* TODO: this is an extremely ugly hack to work around buggy iconvs
|
||||||
that return -1/E2BIG for buffers larger than 0x40000acf */
|
that return -1/E2BIG for buffers larger than 0x40000acf */
|
||||||
if (maxLength > 0x40000000)
|
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
|
* 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.
|
* an empty cache value, so we MUST NOT return a hash of zero.
|
||||||
*/
|
*/
|
||||||
|
ret &= 0x0fffffff;
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
ret = 0x0fffffff;
|
ret = 0x0fffffff;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ret &= 0x0fffffff;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2193,14 +2193,11 @@ handle_printf_atsign (FILE *stream,
|
||||||
* The hash caching in our concrete string classes uses zero to denote
|
* 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.
|
* an empty cache value, so we MUST NOT return a hash of zero.
|
||||||
*/
|
*/
|
||||||
|
ret &= 0x0fffffff;
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
ret = 0x0fffffff;
|
ret = 0x0fffffff;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ret &= 0x0fffffff;
|
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue