diff options
author | randomdan <randomdan@localhost> | 2011-02-04 15:29:09 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-02-04 15:29:09 +0000 |
commit | 037685d5acb86682f2d90970a92f259d4eaa76fa (patch) | |
tree | 9844eaebbc85e4af2c57aaa31d650b7ce165c57d | |
parent | Add concept of runtime configuration, set by HTTP hostname or environment var... (diff) | |
download | project2-037685d5acb86682f2d90970a92f259d4eaa76fa.tar.bz2 project2-037685d5acb86682f2d90970a92f259d4eaa76fa.tar.xz project2-037685d5acb86682f2d90970a92f259d4eaa76fa.zip |
Fix crash caused by taking reference of temp VariableType
-rw-r--r-- | project2/sendmailTask.cpp | 5 |
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: |