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

index 9a8a406729b544e210ca2013533d9680a25c5d27..4979395ddc233be928512055a175737b536f940f 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:
@@ -132,7 +132,7 @@ void dumpCounter(FILE *f, const mpv_counter_info *c) {
 void nfaExecMpv_dump(const NFA *nfa, const string &base) {
     const mpv *m = (const mpv *)getImplNfa(nfa);
 
-    FILE *f = fopen_or_throw((base + ".txt").c_str(), "w");
+    StdioFile f(base + ".txt", "w");
 
     fprintf(f, "Puff the Magic Engines\n");
     fprintf(f, "\n");
@@ -154,7 +154,6 @@ void nfaExecMpv_dump(const NFA *nfa, const string &base) {
     }
 
     dumpTextReverse(nfa, f);
-    fclose(f);
 }
 
 } // namespace ue2