mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-01 12:23:20 +08:00
Fix issues with really long type names
This commit is contained in:
@@ -118,14 +118,9 @@ Class _Nullable ASGetClassFromType(const char *type)
|
||||
return nil;
|
||||
}
|
||||
|
||||
// If it's a protocol, bail
|
||||
if (type[2] == '<') {
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Copy type[2..(end-1)]. So @"UIImage" -> UIImage
|
||||
size_t resultLength = typeLength - 3;
|
||||
char className[40];
|
||||
char className[resultLength + 1];
|
||||
strncpy(className, type + 2, resultLength);
|
||||
className[resultLength] = '\0';
|
||||
return objc_getClass(className);
|
||||
|
||||
Reference in New Issue
Block a user