rem: int i, j, ncnt;
add: int i, j, ncnt, cnt;
context: static void add_virtual_subscriptions_to_rlmi(dstring_t *doc, rl_subscription_t *s, const char *part_id){	int i, j, ncnt;	virtual_subscription_t *vs;	vs_display_name_t dn;	char tmp[32];		/* add all list elements */	vs = s->first_vs;	i = 0;	while (vs) {		dstr_append_zt(doc, "\t<resource uri=\"");		dstr_append_str(doc, &vs->uri);		dstr_append_zt(doc, "\">\n");		/* add display names */		ncnt = vector_size(&vs->display_names);		for (j = 0; j < ncnt; j++) {			if (vector_get(&vs->display_names, j, &dn) != 0) continue;			if (dn.lang.len > 0) {				dstr_append_zt(doc, "\t\t<name language=\"");				dstr_append_str(doc, &dn.lang);				dstr_append_zt(doc, "\">");			}			else dstr_append_zt(doc, "\t\t<name>");			dstr_append_str(doc, &dn.name);			dstr_append_zt(doc, "</name>\n");		}			sprintf(tmp, "vs%di%d", i, 1);		dstr_append_zt(doc, "\t\t<instance id=\"");		dstr_append_zt(doc, tmp);		dstr_append_zt(doc, "\" state=\"");		switch (vs->status) {			case subscription_active: 					dstr_append_zt(doc, "active\"");					break;			case subscription_pending: 					dstr_append_zt(doc, "pending\"");					break;			case subscription_terminated_pending: 			case subscription_terminated: 					dstr_append_zt(doc, "terminated\" reason=\"closed\"");					break;			case subscription_terminated_pending_to: 			case subscription_terminated_to: 					dstr_append_zt(doc, 						"terminated\" reason=\"timeout\"");					break;			case subscription_uninitialized: 					dstr_append_zt(doc, "pending\"");					/* this is an error ! */					LOG(L_ERR, "generating RLMI for an unitialized virtual subscription!\n");					break;		}			if (vs->state_document.len > 0) {			sprintf(tmp, "%d", i);			dstr_append_zt(doc, " cid=\"");			dstr_append_zt(doc, part_id);			dstr_append_zt(doc, tmp);			dstr_append_zt(doc, "\"/>\n");		}		else dstr_append_zt(doc, "/>\n");				dstr_append_zt(doc, "\t</resource>\n");		vs = vs->next;		i++;	}}