X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Frssclient%2Frss_atom_parser.c;h=86346296244eb3504d1f7b5bccaa532b9b805a50;hb=1f6d08274ce7f2bacb657e039880bed95e49e029;hp=0c7290b5cc0857ce856d43a2ce614ca2eedb11aa;hpb=00065577286d65a2ac21f4760190b963cde22a5e;p=citadel.git diff --git a/citadel/modules/rssclient/rss_atom_parser.c b/citadel/modules/rssclient/rss_atom_parser.c index 0c7290b5c..863462962 100644 --- a/citadel/modules/rssclient/rss_atom_parser.c +++ b/citadel/modules/rssclient/rss_atom_parser.c @@ -745,7 +745,7 @@ void rss_save_item(rss_item *ri, rss_aggregator *RSSAggr) len = StrLength(ri->title); Sbj = html_to_ascii(ChrPtr(ri->title), len, 512, 0); len = strlen(Sbj); - if (Sbj[len - 1] == '\n') + if ((len > 0) && (Sbj[len - 1] == '\n')) { len --; Sbj[len] = '\0'; @@ -777,7 +777,7 @@ void rss_save_item(rss_item *ri, rss_aggregator *RSSAggr) msglen += 1024 + StrLength(ri->link) + StrLength(ri->description) ; - Message = NewStrBufPlain(NULL, StrLength(ri->description)); + Message = NewStrBufPlain(NULL, msglen); StrBufPlain(Message, HKEY( "Content-type: text/html; charset=\"UTF-8\"\r\n\r\n" @@ -1086,9 +1086,9 @@ void rss_parser_cleanup(void) DeleteHash(&KnownNameSpaces); } -void LogDebugEnableRSSATOMParser(void) +void LogDebugEnableRSSATOMParser(const int n) { - RSSAtomParserDebugEnabled = 1; + RSSAtomParserDebugEnabled = n; } CTDL_MODULE_INIT(rssparser) @@ -1177,7 +1177,7 @@ CTDL_MODULE_INIT(rssparser) /* we don't like these namespaces because of they shadow our usefull parameters. */ Put(KnownNameSpaces, HKEY("http://search.yahoo.com/mrss/"), NULL, reference_free_handler); #endif - CtdlRegisterDebugFlagHook(HKEY("RSSAtomParser"), LogDebugEnableRSSATOMParser); + CtdlRegisterDebugFlagHook(HKEY("RSSAtomParser"), LogDebugEnableRSSATOMParser, &RSSAtomParserDebugEnabled); CtdlRegisterCleanupHook(rss_parser_cleanup); } return "rssparser";