summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-02-04 15:29:09 +0000
committerrandomdan <randomdan@localhost>2011-02-04 15:29:09 +0000
commitf4b8fa25a02d38260edf167fe94d0002df57b34f (patch)
tree9844eaebbc85e4af2c57aaa31d650b7ce165c57d
parentAdd concept of runtime configuration, set by HTTP hostname or environment var... (diff)
downloadproject2-f4b8fa25a02d38260edf167fe94d0002df57b34f.tar.bz2
project2-f4b8fa25a02d38260edf167fe94d0002df57b34f.tar.xz
project2-f4b8fa25a02d38260edf167fe94d0002df57b34f.zip
Fix crash caused by taking reference of temp VariableType
-rw-r--r--project2/sendmailTask.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/project2/sendmailTask.cpp b/project2/sendmailTask.cpp
index 7987d72..7e0f25f 100644
--- a/project2/sendmailTask.cpp
+++ b/project2/sendmailTask.cpp
@@ -69,6 +69,9 @@ class Header : public SendMailTask::MailPart {
Header(const std::string & h, const VariableType & v) :
header(h), value(v) {
}
+ Header(const std::string & h, const char * v) :
+ header(h), value(v) {
+ }
const char * write(char ** buf, int * len) {
LexicalCall<const char *, void>(boost::bind(&Header::writeText, this, buf, len, _1), value);
return (const char *)*buf;
@@ -78,7 +81,7 @@ class Header : public SendMailTask::MailPart {
*len = asprintf(buf, "%s: %s\r\n", header.c_str(), text);
}
const std::string header;
- const VariableType & value;
+ const VariableType value;
};
class HtmlContent : public SendMailTask::MailPart {
public: