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

index 1514ca8c1aa8a046c6ec54ddd04d9bf9cc973e2b..595b98ec9cb3727bb8b444e05158fb3052107233 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:
@@ -71,7 +71,7 @@ void dumpTextSubCastle(const SubCastle &sub, FILE *f) {
 void nfaExecCastle_dump(const struct NFA *nfa, const string &base) {
     const Castle *c = (const Castle *)getImplNfa(nfa);
 
-    FILE *f = fopen_or_throw((base + ".txt").c_str(), "w");
+    StdioFile f(base + ".txt", "w");
 
     fprintf(f, "Castle multi-tenant repeat engine\n");
     fprintf(f, "\n");
@@ -117,7 +117,6 @@ void nfaExecCastle_dump(const struct NFA *nfa, const string &base) {
         fprintf(f, "Sub %u:\n", i);
         dumpTextSubCastle(sub[i], f);
     }
-    fclose(f);
 }
 
 } // namespace ue2