]> code.citadel.org Git - citadel.git/blobdiff - webcit/availability.c
* --pedantic cleanup.
[citadel.git] / webcit / availability.c
index f2b4cdbe766a65875f52931c9fa9f6df1596865d..f8772780bd8c296bb2f65d3c3e08ea5c83db3b98 100644 (file)
  * Utility function to fetch a VFREEBUSY type of thing for any specified user.
  */
 icalcomponent *get_freebusy_for_user(char *who) {
+       long nLines;
        char buf[SIZ];
-       char *serialized_fb = NULL;
+       StrBuf *serialized_fb = NewStrBuf();
        icalcomponent *fb = NULL;
 
        serv_printf("ICAL freebusy|%s", who);
        serv_getln(buf, sizeof buf);
        if (buf[0] == '1') {
-               serialized_fb = read_server_text();
+               read_server_text(serialized_fb, &nLines);
        }
 
        if (serialized_fb == NULL) {
                return NULL;
        }
        
-       fb = icalcomponent_new_from_string(serialized_fb);
-       free(serialized_fb);
+       fb = icalcomponent_new_from_string(ChrPtr(serialized_fb));
+       FreeStrBuf(&serialized_fb);
        if (fb == NULL) {
                return NULL;
        }
@@ -89,11 +90,11 @@ int ical_ctdl_is_overlap(
 
        /* If event 1 ends before event 2 starts, we're in the clear. */
        if (icaltime_compare(t1end, t2start) <= 0) return(0);
-       // lprintf(9, "first passed\n");
+       /* lprintf(9, "first passed\n"); */
 
        /* If event 2 ends before event 1 starts, we're also ok. */
        if (icaltime_compare(t2end, t1start) <= 0) return(0);
-       // lprintf(9, "second passed\n");
+       /* lprintf(9, "second passed\n"); */
 
        /* Otherwise, they overlap. */
        return(1);