*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
StrBufSpaceToBlank(SaveMsg->title);
len = StrLength(SaveMsg->title);
Sbj = html_to_ascii(ChrPtr(SaveMsg->title), len, 512, 0);
StrBufSpaceToBlank(SaveMsg->title);
len = StrLength(SaveMsg->title);
Sbj = html_to_ascii(ChrPtr(SaveMsg->title), len, 512, 0);
- len = strlen(Sbj);
- if ((len > 0) && (Sbj[len - 1] == '\n'))
- {
- len --;
- Sbj[len] = '\0';
- }
- Encoded = NewStrBufPlain(Sbj, len);
- free(Sbj);
-
- StrBufTrim(Encoded);
- StrBufRFC2047encode(&QPEncoded, Encoded);
+ if (!IsEmptyStr(Sbj)) {
+ len = strlen(Sbj);
+ if ((Sbj[len - 1] == '\n'))
+ {
+ len --;
+ Sbj[len] = '\0';
+ }
+ Encoded = NewStrBufPlain(Sbj, len);
+
- CM_SetAsFieldSB(&SaveMsg->Msg, eMsgSubject, &QPEncoded);
- FreeStrBuf(&Encoded);
+ StrBufTrim(Encoded);
+ StrBufRFC2047encode(&QPEncoded, Encoded);
+
+ CM_SetAsFieldSB(&SaveMsg->Msg, eMsgSubject, &QPEncoded);
+ FreeStrBuf(&Encoded);
+ }
+ if (Sbj != NULL) {
+ free(Sbj);
+ }
pthread_mutex_lock(&RSSQueueMutex);
if (GetHash(RSSQueueRooms, LKEY(qrbuf->QRnumber), &vptr))
{
pthread_mutex_lock(&RSSQueueMutex);
if (GetHash(RSSQueueRooms, LKEY(qrbuf->QRnumber), &vptr))
{