diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-01-05 20:56:35 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-01-05 20:56:35 +0100 |
commit | 477e0dec4d6e9a51af2258611f45adea319ff6ae (patch) | |
tree | 0c340f3babaea2271a0d6c8065108a556555bd5f | |
parent | cde342c78885f070b3905cf84caa917fd7da2eb2 (diff) | |
download | gnunet-477e0dec4d6e9a51af2258611f45adea319ff6ae.tar.gz gnunet-477e0dec4d6e9a51af2258611f45adea319ff6ae.zip |
fix signed/unsigned cmp
-rw-r--r-- | src/regex/regex_test_lib.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c index f4025f652..4e388a70b 100644 --- a/src/regex/regex_test_lib.c +++ b/src/regex/regex_test_lib.c | |||
@@ -164,14 +164,18 @@ new_regex_ctx (unsigned int alphabet_size) | |||
164 | return ctx; | 164 | return ctx; |
165 | } | 165 | } |
166 | 166 | ||
167 | |||
167 | static void | 168 | static void |
168 | move_children (struct RegexCombineCtx *dst, const struct RegexCombineCtx *src) | 169 | move_children (struct RegexCombineCtx *dst, |
170 | const struct RegexCombineCtx *src) | ||
169 | { | 171 | { |
170 | size_t array_size; | 172 | size_t array_size; |
171 | 173 | ||
172 | array_size = sizeof(struct RegexCombineCtx *) * src->size; | 174 | array_size = sizeof(struct RegexCombineCtx *) * src->size; |
173 | memcpy (dst->children, src->children, array_size); | 175 | memcpy (dst->children, |
174 | for (int i = 0; i < src->size; i++) | 176 | src->children, |
177 | array_size); | ||
178 | for (unsigned int i = 0; i < src->size; i++) | ||
175 | { | 179 | { |
176 | src->children[i] = NULL; | 180 | src->children[i] = NULL; |
177 | } | 181 | } |
@@ -402,6 +406,7 @@ regex_split (struct RegexCombineCtx *ctx, | |||
402 | tmp = ctx->children; | 406 | tmp = ctx->children; |
403 | ctx->children = GNUNET_malloc (sizeof(*tmp) * ctx->size); | 407 | ctx->children = GNUNET_malloc (sizeof(*tmp) * ctx->size); |
404 | regex_add_multiple (ctx, suffix, tmp); | 408 | regex_add_multiple (ctx, suffix, tmp); |
409 | GNUNET_free (suffix); | ||
405 | GNUNET_free (tmp); | 410 | GNUNET_free (tmp); |
406 | return; | 411 | return; |
407 | } | 412 | } |