From e791472799eb4dd4396699a3efc8dba7cdfeaafd Mon Sep 17 00:00:00 2001 From: Alexander Bezzubov Date: Wed, 8 May 2019 14:19:07 +0200 Subject: [PATCH] cgo: simplify naive encoding init Signed-off-by: Alexander Bezzubov --- chelper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chelper.c b/chelper.c index a7e3ba1..d768a77 100644 --- a/chelper.c +++ b/chelper.c @@ -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));