diff --git a/ChangeLog b/ChangeLog index 86cbaea1a..6c4b2a250 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-24 08:25-EDT Gregory John Casamento + + * Source/NSUserDefaults.m: -addSuiteNamed change so that we don't + rely on the value of NSNotFound being -(2^32)-1 and a rollover to + 0. + 2008-09-23 20:31-EDT Gregory John Casamento * config.mak.in: Added reference to HAVE_OBJC_SYNC_ENTER diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index 6ecd16e00..ff04302b4 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -925,7 +925,10 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */ if (self == sharedDefaults) invalidatedLanguages = YES; [_searchList removeObject: aName]; index = [_searchList indexOfObject: processName]; - index++; // NSNotFound wraps to zero ... insert at start. + if(index == NSNotFound) + { + index = 0; // NSNotFound, insert at start. + } aName = [aName copy]; [_searchList insertObject: aName atIndex: index]; [_lock unlock];