rem: var str = {}; convStream.readString(-1, str); 
add: var tmpStr = {}; var str = ""; while (convStream.readString(-1, tmpStr)) { str += tmpStr.value; } 
context: function ics_importFromStream(aStream, aCount) {    var items = new Array();    // Interpret the byte-array as an utf8 string, and convert into a    // javascript string.    var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]                               .getService(Components.interfaces.nsIConverterInputStream);    convStream.init(aStream, 'UTF-8', 0, 0x0000);    var str = {};    convStream.readString(-1, str);    icssrv = Components.classes["@mozilla.org/calendar/ics-service;1"]                       .getService(Components.interfaces.calIICSService);    var calComp = icssrv.parseICS(str.value);    var subComp = calComp.getFirstSubcomponent("ANY");    while (subComp) {        switch (subComp.componentType) {        case "VEVENT":            var event = Components.classes["@mozilla.org/calendar/event;1"]                                  .createInstance(Components.interfaces.calIEvent);            event.icalComponent = subComp;            items.push(event);            break;        case "VTODO":            var todo = Components.classes["@mozilla.org/calendar/todo;1"]                                 .createInstance(Components.interfaces.calITodo);            todo.icalComponent = subComp;            items.push(todo);            break;        default:            // Nothing        }        subComp = calComp.getNextSubcomponent("ANY");    }    aCount.value = items.length;    return items;};
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/d57fba0bf3b1a50974a80b2c25a189e0ad14b26f/calIcsImportExport.js/buggy/calendar/import-export/calIcsImportExport.js