From e88418c0145ddeba97116e49074dd8e2e9edea7a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 22 Dec 2014 23:05:12 +0000 Subject: Make memleakfinder_setup_exit_report() take a std::string, for C++ style. --- lib/common/DebugMemLeakFinder.cpp | 5 +++-- lib/common/MemLeakFinder.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/common') diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp index a7d87528..d2109d7b 100644 --- a/lib/common/DebugMemLeakFinder.cpp +++ b/lib/common/DebugMemLeakFinder.cpp @@ -586,9 +586,10 @@ extern "C" void memleakfinder_atexit() memleakfinder_reportleaks_appendfile(atexit_filename, atexit_markertext); } -void memleakfinder_setup_exit_report(const char *filename, const char *markertext) +void memleakfinder_setup_exit_report(const std::string& filename, + const char *markertext) { - ::strncpy(atexit_filename, filename, sizeof(atexit_filename)-1); + ::strncpy(atexit_filename, filename.c_str(), sizeof(atexit_filename)-1); ::strncpy(atexit_markertext, markertext, sizeof(atexit_markertext)-1); atexit_filename[sizeof(atexit_filename)-1] = 0; atexit_markertext[sizeof(atexit_markertext)-1] = 0; diff --git a/lib/common/MemLeakFinder.h b/lib/common/MemLeakFinder.h index 1a2cf90c..3beedbe9 100644 --- a/lib/common/MemLeakFinder.h +++ b/lib/common/MemLeakFinder.h @@ -43,7 +43,7 @@ void memleakfinder_reportleaks(); void memleakfinder_reportleaks_appendfile(const char *filename, const char *markertext); -void memleakfinder_setup_exit_report(const char *filename, const char *markertext); +void memleakfinder_setup_exit_report(const std::string& filename, const char *markertext); void memleakfinder_startsectionmonitor(); -- cgit v1.2.3