-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a fix for FontDescriptor.m #4
Comments
I guess that is possible (well, obviously it is if you observed it). But the next line compares the type to "FontDescriptor" which is the expected type of dictionary. If the type comes out nil, shouldn't the comparison return a non-equal (non-zero) result, like 1 (since any string at all is greater than nothing)? If this is so, then the object is released and nil returned.
|
Looks like strcmp doesn't like nil strings. Sent from my iPhone On Oct 21, 2011, at 6:12 PM, KurtCode
|
That's interesting, I didn't know that. Thanks! It appears strcmp behavior is undefined for nil arguments. |
Hi! Laurent |
In FontDescriptor.m, - (id)initWithPDFDictionary:(CGPDFDictionaryRef)dict, CGPDFDictionaryGetName(dict, "Type", &type) sometimes returns a nil in type.
Testing as follows goes around the problem:
if (type == nil)
{
[self release]; return nil;
}
Laurent.
The text was updated successfully, but these errors were encountered: