diff options
| author | liuwentan <[email protected]> | 2023-04-14 16:51:09 +0800 |
|---|---|---|
| committer | liuwentan <[email protected]> | 2023-04-14 16:51:09 +0800 |
| commit | e89bb89fa9a37adb9308cd70d38a87f077a51b4f (patch) | |
| tree | bfea98e94fa4745f197ad1ba915a7c4d29d9767c /tools | |
| parent | 923b4c4168e6313a6e1367d9782202e06176acd2 (diff) | |
fix maat_redis_tool bug
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/maat_redis_tool.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/maat_redis_tool.cpp b/tools/maat_redis_tool.cpp index 36d9321..d0444c6 100644 --- a/tools/maat_redis_tool.cpp +++ b/tools/maat_redis_tool.cpp @@ -165,6 +165,12 @@ void read_rule_from_redis(redisContext *c, long long desire_version, const char cur_table = rule_list[i].table_name; } + + size_t line_len = strlen(rule_list[i].table_line); + if (rule_list[i].table_line[line_len - 1] == '\n') { + rule_list[i].table_line[line_len - 1] = '\0'; + } + fprintf(table_fp, "%s\tkey=%lld\n", rule_list[i].table_line, rule_list[i].rule_id); line_count++; } |
