diff --git a/src/util/labelanalysis.hpp b/src/util/labelanalysis.hpp index b87a4fd6..c83a3195 100644 --- a/src/util/labelanalysis.hpp +++ b/src/util/labelanalysis.hpp @@ -166,7 +166,7 @@ void analyze_labels(std::string basefilename, int printtop = 20) { std::string outname = basefilename + ".components"; std::ofstream resf; resf.open(outname.c_str()); - if (resf == NULL) { + if (!resf) { logstream(LOG_ERROR) << "Could not write label outputfile : " << outname << std::endl; return; } diff --git a/toolkits/graph_analytics/label_analysis.hpp b/toolkits/graph_analytics/label_analysis.hpp index 05e73385..dd6202b1 100644 --- a/toolkits/graph_analytics/label_analysis.hpp +++ b/toolkits/graph_analytics/label_analysis.hpp @@ -157,7 +157,7 @@ void analyze_labels2(std::string base_filename, FILE * pfile, int printtop = 20) /* Write output file */ std::string outname = base_filename + "_components.txt"; FILE * resf = fopen(outname.c_str(), "w"); - if (resf == NULL) { + if (!resf) { logstream(LOG_ERROR) << "Could not write label outputfile : " << outname << std::endl; return; }