summaryrefslogtreecommitdiff
path: root/clients/zleave
diff options
context:
space:
mode:
authorGravatar John F. Carr <jfc@mit.edu>1991-06-20 10:37:21 +0000
committerGravatar John F. Carr <jfc@mit.edu>1991-06-20 10:37:21 +0000
commit7996a85a7e9bc45f8f182c941d6ed95256591e9b (patch)
tree390693aa9ade236da9ee082f25be6bcb2786190e /clients/zleave
parenteacc1d17b7c00626128e897fe093cd2f1409b9fb (diff)
Add zsub_ prefix to field names in subscription structure.
Check for NULL return from malloc. Use \a instead of \7 for a bell.
Diffstat (limited to 'clients/zleave')
-rw-r--r--clients/zleave/zleave.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/clients/zleave/zleave.c b/clients/zleave/zleave.c
index 4c6c252..d854c06 100644
--- a/clients/zleave/zleave.c
+++ b/clients/zleave/zleave.c
@@ -93,9 +93,9 @@ char **argv;
fprintf(stderr,"Will write directly to terminal.\n");
use_zephyr = 0;
} else {
- sub.class = MESSAGE_CLASS;
- sub.classinst = INSTANCE;
- sub.recipient = ZGetSender();
+ sub.zsub_class = MESSAGE_CLASS;
+ sub.zsub_classinst = INSTANCE;
+ sub.zsub_recipient = ZGetSender();
if (ZSubscribeTo(&sub,1,(u_short)port) != ZERR_NONE) {
fprintf(stderr,
"Subscription error! Writing to your terminal...\n");
@@ -313,6 +313,10 @@ char *msg;
if (use_zephyr) {
real_message = (char *) malloc(strlen(msg) +
strlen(reminder_message) + 2);
+ if (real_message == NULL) {
+ fprintf (stderr, "zleave: out of memory\n");
+ exit (1);
+ }
sprintf(real_message,"%c%s\n%s",'\0',msg,reminder_message);
(void) bzero((char *)&notice, sizeof(notice));
@@ -358,7 +362,11 @@ char *msg;
ZFreeNotice(&retnotice);
free(real_message);
} else
+#ifdef __STDC__
+ printf("\a\a\a%s\n%s", msg, reminder_message);
+#else
printf("\7\7\7%s\n%s", msg, reminder_message);
+#endif
}
/*