Fix for calendar categories and priorities according to ISO C90

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@284850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jan Kalab
2010-09-03 12:48:59 +00:00
parent e7603921cf
commit 2cd6f30f3b

View File

@@ -544,6 +544,7 @@ static int ewscal_write_event(struct ast_calendar_event *event)
.pvt = pvt, .pvt = pvt,
}; };
int ret; int ret;
char *category, *categories;
if (!pvt) { if (!pvt) {
return -1; return -1;
@@ -603,8 +604,8 @@ static int ewscal_write_event(struct ast_calendar_event *event)
/* Event categories*/ /* Event categories*/
if (strlen(event->categories) > 0) { if (strlen(event->categories) > 0) {
ast_str_append(&request, 0, "<Categories>"); ast_str_append(&request, 0, "<Categories>");
char *categories = strdupa(event->categories); /* Duplicate string, since strsep() is destructive */ categories = strdupa(event->categories); /* Duplicate string, since strsep() is destructive */
char *category = strsep(&categories, ","); category = strsep(&categories, ",");
while (category != NULL) { while (category != NULL) {
ast_str_append(&request, 0, "<String>%s</String>", category); ast_str_append(&request, 0, "<String>%s</String>", category);
category = strsep(&categories, ","); category = strsep(&categories, ",");