]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
rose_in_dump: use StdioFile
authorJustin Viiret <justin.viiret@intel.com>
Thu, 29 Jun 2017 03:17:04 +0000 (13:17 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 21 Aug 2017 01:12:16 +0000 (11:12 +1000)
src/rose/rose_in_dump.cpp

index 172b58e8417466cac2dd523b3decc3c00c77b393..5266e9d7da8044a7df42a9b7e9bbffeddf6602f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -35,6 +35,7 @@
 #include "nfagraph/ng_dump.h"
 #include "nfagraph/ng_util.h"
 #include "util/container.h"
+#include "util/dump_util.h"
 #include "util/graph_range.h"
 
 #include <cstdio>
@@ -59,7 +60,7 @@ void dumpPreRoseGraph(const RoseInGraph &ig, const Grey &grey,
         filename = "pre_rose.dot";
     }
     DEBUG_PRINTF("dumping rose graphs\n");
-    FILE *f = fopen((grey.dumpPath + filename).c_str(), "w");
+    StdioFile f(grey.dumpPath + filename, "w");
     fprintf(f, "digraph NFA {\n");
     fprintf(f, "rankdir=LR;\n");
     fprintf(f, "size=\"11.5,8\"\n");
@@ -127,7 +128,6 @@ void dumpPreRoseGraph(const RoseInGraph &ig, const Grey &grey,
     }
 
     fprintf(f, "}\n");
-    fclose(f);
 }
 
 }