ambrop7 13 лет назад
Родитель
Сommit
43110fd7db
2 измененных файлов с 4 добавлено и 4 удалено
  1. 1 1
      ncd/modules/explode.c
  2. 3 3
      ncd/modules/regex_match.c

+ 1 - 1
ncd/modules/explode.c

@@ -198,7 +198,7 @@ static int func_getvar (void *vo, const char *name, NCDValMem *mem, NCDValRef *o
         }
         }
         for (size_t j = 0; j < o->num; j++) {
         for (size_t j = 0; j < o->num; j++) {
             struct substring *elem = &((struct substring *)o->arr.v)[j];
             struct substring *elem = &((struct substring *)o->arr.v)[j];
-            NCDValRef str = NCDVal_NewStringBin(mem, elem->data, elem->len);
+            NCDValRef str = NCDVal_NewStringBin(mem, (uint8_t *)elem->data, elem->len);
             if (NCDVal_IsInvalid(str)) {
             if (NCDVal_IsInvalid(str)) {
                 ModuleLog(o->i, BLOG_ERROR, "NCDVal_NewStringBin failed");
                 ModuleLog(o->i, BLOG_ERROR, "NCDVal_NewStringBin failed");
                 goto fail;
                 goto fail;

+ 3 - 3
ncd/modules/regex_match.c

@@ -267,7 +267,7 @@ static void replace_func_new (void *vo, NCDModuleInst *i)
         
         
         // if no match, append remaining data and finish
         // if no match, append remaining data and finish
         if (!have_match) {
         if (!have_match) {
-            if (!ExpString_AppendBinary(&out, in + in_pos, in_len - in_pos)) {
+            if (!ExpString_AppendBinary(&out, (const uint8_t *)in + in_pos, in_len - in_pos)) {
                 ModuleLog(i, BLOG_ERROR, "ExpString_AppendBinary failed");
                 ModuleLog(i, BLOG_ERROR, "ExpString_AppendBinary failed");
                 goto fail3;
                 goto fail3;
             }
             }
@@ -275,14 +275,14 @@ static void replace_func_new (void *vo, NCDModuleInst *i)
         }
         }
         
         
         // append data before match
         // append data before match
-        if (!ExpString_AppendBinary(&out, in + in_pos, match.rm_so)) {
+        if (!ExpString_AppendBinary(&out, (const uint8_t *)in + in_pos, match.rm_so)) {
             ModuleLog(i, BLOG_ERROR, "ExpString_AppendBinary failed");
             ModuleLog(i, BLOG_ERROR, "ExpString_AppendBinary failed");
             goto fail3;
             goto fail3;
         }
         }
         
         
         // append replacement data
         // append replacement data
         NCDValRef replace = NCDVal_ListGet(replace_arg, match_regex);
         NCDValRef replace = NCDVal_ListGet(replace_arg, match_regex);
-        if (!ExpString_AppendBinary(&out, NCDVal_StringValue(replace), NCDVal_StringLength(replace))) {
+        if (!ExpString_AppendBinary(&out, (const uint8_t *)NCDVal_StringValue(replace), NCDVal_StringLength(replace))) {
             ModuleLog(i, BLOG_ERROR, "ExpString_AppendBinary failed");
             ModuleLog(i, BLOG_ERROR, "ExpString_AppendBinary failed");
             goto fail3;
             goto fail3;
         }
         }