Skip to content

Commit

Permalink
Removed unneeded memory allocation and by that fixed a bug in the use…
Browse files Browse the repository at this point in the history
… of memset
  • Loading branch information
griff committed Jan 18, 2011
1 parent 72bf996 commit a4d44da
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions framework/core/OnigRegexp.m
Expand Up @@ -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);
Expand Down

0 comments on commit a4d44da

Please sign in to comment.