Changeset e01449c
- Timestamp:
- Mar 29, 2009, 4:59:32 PM (13 years ago)
- Branches:
- owl
- Children:
- 765fa34
- Parents:
- 61f7250
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r488ebf6 re01449c 2095 2095 { 2096 2096 owl_fmtext fm; 2097 char *ptr, buff[LINE];2097 char *ptr, *buff; 2098 2098 int i; 2099 2099 … … 2102 2102 for (i=0; i<argc; i++) { 2103 2103 ptr=long_zuser(argv[i]); 2104 owl_zephyr_zlocate(ptr, buff, auth);2104 buff=owl_zephyr_zlocate(ptr, auth); 2105 2105 owl_fmtext_append_normal(&fm, buff); 2106 2106 owl_free(ptr); 2107 owl_free(buff); 2107 2108 } 2108 2109 -
zephyr.c
rdab82f29 re01449c 487 487 void owl_zephyr_handle_ack(ZNotice_t *retnotice) 488 488 { 489 char *tmp ;489 char *tmp, *buff; 490 490 491 491 /* if it's an HMACK ignore it */ … … 509 509 } else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) { 510 510 if (strcasecmp(retnotice->z_class, "message")) { 511 char buff[1024];512 511 owl_function_error("No one subscribed to class class %s", retnotice->z_class); 513 sprintf(buff, "Could not send message to class %s: no one subscribed.\n", retnotice->z_class); 512 buff=owl_sprintf("Could not send message to class %s: no one subscribed.\n", 513 retnotice->z_class); 514 514 owl_function_adminmsg("", buff); 515 owl_free(buff); 515 516 } else { 516 char buff[1024];517 517 tmp = short_zuser(retnotice->z_recipient); 518 518 owl_function_error("%s: Not logged in or subscribing to messages.", tmp); 519 sprintf(buff, "Could not send message to %s: not logged in or subscribing to messages.\n", tmp); 519 buff=owl_sprintf("Could not send message to %s: not logged in or subscribing to messages.\n", 520 tmp); 520 521 owl_function_adminmsg("", buff); 521 522 owl_log_outgoing_zephyr_error(tmp, buff); 522 523 owl_free(tmp); 524 owl_free(buff); 523 525 } 524 526 } else { … … 609 611 #endif 610 612 611 void owl_zephyr_zlocate(char *user, char *out, int auth)613 char *owl_zephyr_zlocate(char *user, int auth) 612 614 { 613 615 #ifdef HAVE_LIBZEPHYR … … 615 617 int one = 1; 616 618 ZLocations_t locations; 617 char *myuser; 618 619 strcpy(out, ""); 619 char *myuser, *out, *tmp; 620 620 621 ZResetAuthentication(); 621 622 ret=ZLocateUser(user,&numlocs,auth?ZAUTH:ZNOAUTH); 622 623 if (ret != ZERR_NONE) { 623 sprintf(out, "Error locating user %s\n", user); 624 return; 624 return(owl_sprintf("Error locating user %s\n", user)); 625 625 } 626 626 627 627 if (numlocs==0) { 628 628 myuser=short_zuser(user); 629 sprintf(out, "%s: Hidden or not logged-in\n", myuser);629 out=owl_sprintf("%s: Hidden or not logged in\n", myuser); 630 630 owl_free(myuser); 631 return; 632 } 633 631 return(out); 632 } 633 634 out=strdup(""); 634 635 for (;numlocs;numlocs--) { 635 636 ZGetLocations(&locations,&one); 636 637 myuser=short_zuser(user); 637 sprintf(out, "%s%s: %s\t%s\t%s\n", out, myuser, 638 locations.host ? locations.host : "?", 639 locations.tty ? locations.tty : "?", 640 locations.time ? locations.time : "?"); 638 tmp=owl_sprintf("%s%s: %s\t%s\t%s\n", 639 out, 640 myuser, 641 locations.host ? locations.host : "?", 642 locations.tty ? locations.tty : "?", 643 locations.time ? locations.time : "?"); 644 owl_free(out); 645 out=tmp; 641 646 owl_free(myuser); 642 647 } 648 return(out); 643 649 #endif 644 650 }
Note: See TracChangeset
for help on using the changeset viewer.