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

+ 2 - 2
examples/substring_test.c

@@ -133,10 +133,10 @@ static void test_substring (int word_len, int text_len, int word_count, int text
                 text[k] = rand() % 2;
             }
             
-            size_t pos;
+            size_t pos = 36; // to remove warning
             int res = find_substring(text, text_len, word, word_len, table, &pos);
             
-            size_t spos;
+            size_t spos = 59; // to remove warning
             int sres = find_substring_slow(text, text_len, word, word_len, &spos);
             
             ASSERT_FORCE(res == sres)

+ 1 - 1
ncd/modules/regex_match.c

@@ -253,7 +253,7 @@ static void replace_func_new (void *vo, NCDModuleInst *i)
         // find first match
         int have_match = 0;
         size_t match_regex;
-        regmatch_t match;
+        regmatch_t match = {0, 0}; // to remove warning
         for (size_t j = 0; j < num_regex; j++) {
             regmatch_t this_match;
             this_match.rm_so = 0;