Permalink
Browse files

Removed unneeded memory allocation and by that fixed a bug in the use…

… of memset
  • Loading branch information...
1 parent 72bf996 commit a4d44dac8156f7f48f60280da70951eaaa8ceda4 @griff griff committed Jan 18, 2011
Showing with 1 addition and 3 deletions.
  1. +1 −3 framework/core/OnigRegexp.m
View
4 framework/core/OnigRegexp.m
@@ -264,9 +264,7 @@ - (int)indexForName:(NSString*)name
- (NSIndexSet*)indexesForName:(NSString*)name
{
- int len = sizeof(int) * [self count];
- int* buf = alloca(len);
- memset(&buf, 0, len);
+ int* buf = NULL;
const UChar* str = (const UChar*)[name cStringUsingEncoding:STRING_ENCODING];
int num = onig_name_to_group_numbers([_expression entity], str, str + [name length] * CHAR_SIZE, &buf);

0 comments on commit a4d44da

Please sign in to comment.