From a659b9b686876810c94c7556e26719b25f4e8005 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Thu, 29 Jun 2017 13:20:31 +1000 Subject: [PATCH] slot_manager_dump: use StdioFile --- src/som/slot_manager_dump.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/som/slot_manager_dump.cpp b/src/som/slot_manager_dump.cpp index 484d6c14..4ed5cef0 100644 --- a/src/som/slot_manager_dump.cpp +++ b/src/som/slot_manager_dump.cpp @@ -36,10 +36,11 @@ #include "nfagraph/ng_dump.h" #include "nfagraph/ng_is_equal.h" #include "util/container.h" +#include "util/dump_util.h" #include "ue2common.h" -#include #include +#include #include #ifndef DUMP_SUPPORT @@ -55,7 +56,6 @@ void dumpSomSlotManager(const SomSlotManager &ssm, const Grey &grey) { return; } - string filename = grey.dumpPath + "/ssm.txt"; map by_slot; map by_slot_ir; @@ -67,7 +67,7 @@ void dumpSomSlotManager(const SomSlotManager &ssm, const Grey &grey) { by_slot_ir[e.slot] = &e; } - FILE *f = fopen(filename.c_str(), "w"); + StdioFile f(grey.dumpPath + "/ssm.txt", "w"); fprintf(f, "slot width %u bytes\n\n", ssm.precision); @@ -94,8 +94,6 @@ void dumpSomSlotManager(const SomSlotManager &ssm, const Grey &grey) { } } - fclose(f); - for (const auto &h : ssm.cache->initial_prefixes) { dumpHolder(*h, hash_holder(*h), "ssm_prefix", grey); }