Changeset 9bd2c17 for functions.c


Ignore:
Timestamp:
Aug 17, 2002, 1:50:48 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5eeea3b
Parents:
67103d4
Message:
Changed getsubs to print subs in the order you get them in.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r59cf91c r9bd2c17  
    12631263  int ret, num, i, one;
    12641264  ZSubscription_t sub;
    1265   char *buff;
     1265  char *buff, *tmpbuff;
    12661266
    12671267  one = 1;
     
    12691269  ret=ZRetrieveSubscriptions(0, &num);
    12701270  if (ret == ZERR_TOOMANYSUBS) {
    1271 
    1272   }
    1273 
    1274   buff=owl_malloc(num*200);
     1271    owl_function_makemsg("Zephyr: too many subscriptions");
     1272    return;
     1273  }
     1274
     1275  buff=owl_malloc(num*500);
     1276  tmpbuff=owl_malloc(2048);
    12751277  strcpy(buff, "");
    12761278  for (i=0; i<num; i++) {
    12771279    if ((ret = ZGetSubscriptions(&sub, &one)) != ZERR_NONE) {
    1278       /* deal with error */
     1280      owl_function_makemsg("Error while getting subscriptions");
     1281      owl_free(buff);
     1282      owl_free(tmpbuff);
     1283      ZFlushSubscriptions();
     1284      return;
    12791285    } else {
    1280       sprintf(buff, "%s<%s,%s,%s>\n", buff, sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient);
     1286      sprintf(tmpbuff, "<%s,%s,%s>\n%s", sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient, buff);
     1287      strcpy(buff, tmpbuff);
    12811288    }
    12821289  }
     
    12841291  owl_function_popless_text(buff);
    12851292  owl_free(buff);
     1293  owl_free(tmpbuff);
    12861294  ZFlushSubscriptions();
    12871295}
Note: See TracChangeset for help on using the changeset viewer.