- declare variables at the beginning of the function (GH #2146)
- error message: redis_dbase.c: In function 'db_redis_scan_query_keys':
redis_dbase.c:1086:5: error: 'for' loop initial declarations are only allowed in C99 mode
for (redis_key_t *set_key = set_keys; set_key; set_key = set_key->next)
... | ... |
@@ -923,6 +923,7 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, |
923 | 923 |
char *match = NULL; |
924 | 924 |
int ret; |
925 | 925 |
redisReply *reply = NULL; |
926 |
+ redis_key_t *set_key = NULL; |
|
926 | 927 |
int i, j; |
927 | 928 |
|
928 | 929 |
*query_keys = NULL; |
... | ... |
@@ -1083,7 +1084,7 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, |
1083 | 1084 |
|
1084 | 1085 |
ret = -1; |
1085 | 1086 |
|
1086 |
- for (redis_key_t *set_key = set_keys; set_key; set_key = set_key->next) { |
|
1087 |
+ for (set_key = set_keys; set_key; set_key = set_key->next) { |
|
1087 | 1088 |
LM_DBG("pulling set members from key '%.*s'\n", set_key->key.len, set_key->key.s); |
1088 | 1089 |
|
1089 | 1090 |
redis_key_t *query_v = NULL; |