summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/corefile.cpp
diff options
context:
space:
mode:
author Miodrag Milanović <mmicko@gmail.com>2016-01-11 09:18:43 +0100
committer Miodrag Milanović <mmicko@gmail.com>2016-01-11 09:18:43 +0100
commit36195292e370de0fb6b32085c105a236995ce36e (patch)
tree1fb147c3e21824272b60e4989f606bc9c206030c /src/lib/util/corefile.cpp
parent7c944fa3b02cd26dec3c27f1e6a4c0d33f462c4e (diff)
parent115db95642ad6d861aad63775b92350e0491f2dd (diff)
Merge pull request #561 from ajrhacker/strings
Return std::string objects by value rather than pass by reference [ajrhacker]
Diffstat (limited to 'src/lib/util/corefile.cpp')
-rw-r--r--src/lib/util/corefile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp
index a2242c133c6..344a2922bfe 100644
--- a/src/lib/util/corefile.cpp
+++ b/src/lib/util/corefile.cpp
@@ -909,7 +909,7 @@ file_error core_truncate(core_file *f, UINT64 offset)
assumptions about path separators
-------------------------------------------------*/
-std::string &core_filename_extract_base(std::string &result, const char *name, bool strip_extension)
+std::string core_filename_extract_base(const char *name, bool strip_extension)
{
/* find the start of the name */
const char *start = name + strlen(name);
@@ -917,7 +917,7 @@ std::string &core_filename_extract_base(std::string &result, const char *name, b
start--;
/* copy the rest into an astring */
- result.assign(start);
+ std::string result(start);
/* chop the extension if present */
if (strip_extension)