1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-23 19:39:06 +00:00

Fixed crash when RSS feed item didn't have title

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@879 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Toni Spets 2007-06-06 14:19:09 +00:00
parent 02960c2c7f
commit 204886795a

View File

@ -4330,12 +4330,14 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
else show = obj->data.rss.act_par;
for(itmp = 0; itmp < show; itmp++) {
PRSS_Item *item = &data->items[itmp];
if(i>0)
strncat(p, "\n", p_max_size);
str = item->title;
if(str[strlen(str)-1] == '\n')
str[strlen(str)-1] = 0; // remove trailing new line if one exists
strncat(p, item->title, p_max_size);
if(str) {
if(i>0)
strncat(p, "\n", p_max_size);
if(str[strlen(str)-1] == '\n')
str[strlen(str)-1] = 0; // remove trailing new line if one exists
strncat(p, item->title, p_max_size);
}
}
}
}