mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
improve error checking
This commit is contained in:
parent
c0d6599def
commit
033b921903
2 changed files with 11 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
* Source/NSPropertyList.m: check step before use
|
||||
* Source/NSDate.m: add comment that we are ignoring non-digits
|
||||
* Source/NSCache.m: use double division for calcualting averrage
|
||||
* Source/NSPredicate.m: check for termination of quoted strings
|
||||
|
||||
2018-02-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -2404,7 +2404,11 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
format: @"Invalid double quoted literal at %u", location];
|
||||
}
|
||||
[self setCharactersToBeSkipped: skip];
|
||||
[self scanString: @"\"" intoString: NULL];
|
||||
if (NO == [self scanString: @"\"" intoString: NULL])
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Unterminated double quoted literal at %u", location];
|
||||
}
|
||||
return [NSExpression expressionForConstantValue: str];
|
||||
}
|
||||
|
||||
|
@ -2421,7 +2425,11 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
format: @"Invalid single quoted literal at %u", location];
|
||||
}
|
||||
[self setCharactersToBeSkipped: skip];
|
||||
[self scanString: @"'" intoString: NULL];
|
||||
if (NO == [self scanString: @"'" intoString: NULL])
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Unterminated single quoted literal at %u", location];
|
||||
}
|
||||
return [NSExpression expressionForConstantValue: str];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue