summaryrefslogtreecommitdiff
path: root/src/sp_pcre_compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_pcre_compat.c')
-rw-r--r--src/sp_pcre_compat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sp_pcre_compat.c b/src/sp_pcre_compat.c
index 795903d..3b3b7f5 100644
--- a/src/sp_pcre_compat.c
+++ b/src/sp_pcre_compat.c
@@ -4,13 +4,15 @@
4 4
5sp_pcre* sp_pcre_compile(const char* const pattern) { 5sp_pcre* sp_pcre_compile(const char* const pattern) {
6 sp_pcre* ret = NULL; 6 sp_pcre* ret = NULL;
7 const char* pcre_error = NULL;
8#ifdef SP_HAS_PCRE2 7#ifdef SP_HAS_PCRE2
8 char pcre_error[128] = {0};
9 int errornumber; 9 int errornumber;
10 PCRE2_SIZE erroroffset; 10 PCRE2_SIZE erroroffset;
11 ret = pcre2_compile((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED, 11 ret = pcre2_compile((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED,
12 PCRE2_CASELESS, &errornumber, &erroroffset, NULL); 12 PCRE2_CASELESS, &errornumber, &erroroffset, NULL);
13 pcre2_get_error_message(errornumber, pcre_error, sizeof(pcre_error));
13#else 14#else
15 const char* pcre_error = NULL;
14 int erroroffset; 16 int erroroffset;
15 ret = pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL); 17 ret = pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL);
16#endif 18#endif