From 94e09f24c70dbbfd12d32b4f1ac16e0bc69afc07 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 18 Apr 2011 15:34:35 +0000 Subject: [PATCH] fixed crash in test_core --- modules/core/src/system.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index 24c5148798..e4ef11e91c 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -363,9 +363,10 @@ string tempfile( const char* suffix ) #endif if (*name == '\\') ++name; + string n(name); if (suffix != 0) - return string(buf) + suffix; - return buf; + n += (n[n.size()-1] == '.' && suffix[0] == '.' ? suffix + 1 : suffix); + return n; } static CvErrorCallback customErrorCallback = 0;