summaryrefslogtreecommitdiff
path: root/lib/common/DebugMemLeakFinder.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-10-26 23:36:44 +0000
committerChris Wilson <chris+github@qwirx.com>2008-10-26 23:36:44 +0000
commitb3f8f4e3c840369478e7ad7667297ba3455e19a8 (patch)
treed672a4ae028f394d42e2d23b49674b56bdc6c91d /lib/common/DebugMemLeakFinder.cpp
parent0c61264ce01b854b9a863ac8a942465a1a94f7f8 (diff)
Silence warnings from openbsd gcc by using strncpy instead of strcpy.
Diffstat (limited to 'lib/common/DebugMemLeakFinder.cpp')
-rw-r--r--lib/common/DebugMemLeakFinder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp
index 9fcabd81..90372a72 100644
--- a/lib/common/DebugMemLeakFinder.cpp
+++ b/lib/common/DebugMemLeakFinder.cpp
@@ -420,8 +420,10 @@ extern "C" void memleakfinder_atexit()
void memleakfinder_setup_exit_report(const char *filename, const char *markertext)
{
- ::strcpy(atexit_filename, filename);
- ::strcpy(atexit_markertext, markertext);
+ ::strncpy(atexit_filename, filename, 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;
if(!atexit_registered)
{
atexit(memleakfinder_atexit);