Skip to content

Commit

Permalink
cgo: simplify naive encoding init
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Bezzubov <[email protected]>
  • Loading branch information
bzz committed May 8, 2019
1 parent 2b067fd commit e791472
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions chelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ int NewOnigRegex( char *pattern, int pattern_length, int option,
*error_info = (OnigErrorInfo *) malloc(sizeof(OnigErrorInfo));
memset(*error_info, 0, sizeof(OnigErrorInfo));

OnigEncoding use_encs[] = { *encoding };
onig_initialize(use_encs, sizeof(use_encs)/sizeof(use_encs[0]));
onig_initialize_encoding(*encoding);

*error_buffer = (char*) malloc(ONIG_MAX_ERROR_MESSAGE_LEN * sizeof(char));

Expand Down

0 comments on commit e791472

Please sign in to comment.