summaryrefslogtreecommitdiff
path: root/lib/ZRetSubs.c
diff options
context:
space:
mode:
authorGravatar Robert S. French <rfrench@mit.edu>1987-07-10 10:51:44 +0000
committerGravatar Robert S. French <rfrench@mit.edu>1987-07-10 10:51:44 +0000
commitc13b250fd124b7c2caa4306a777da3f63a1c46cb (patch)
tree2948daaf773c64597536da7bc5f5c65713f660d8 /lib/ZRetSubs.c
parent905f6b97a1f740a984f368f8756b8368e355ce2a (diff)
Added * handling
Diffstat (limited to 'lib/ZRetSubs.c')
-rw-r--r--lib/ZRetSubs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ZRetSubs.c b/lib/ZRetSubs.c
index 9522eec..0762f7b 100644
--- a/lib/ZRetSubs.c
+++ b/lib/ZRetSubs.c
@@ -25,7 +25,7 @@ Code_t ZRetrieveSubscriptions(port,nsubs)
int i,retval;
ZNotice_t notice,retnotice;
ZPacket_t buffer;
- char *ptr,*end;
+ char *ptr,*end,*ptr2;
retval = ZFlushSubscriptions();
@@ -83,11 +83,14 @@ Code_t ZRetrieveSubscriptions(port,nsubs)
return (ENOMEM);
(void) strcpy(__subscriptions_list[i].classinst,ptr);
ptr += strlen(ptr)+1;
+ ptr2 = ptr;
+ if (!*ptr2)
+ ptr2 = "*";
__subscriptions_list[i].recipient = (char *)
- malloc((unsigned)strlen(ptr)+1);
+ malloc((unsigned)strlen(ptr2)+1);
if (!__subscriptions_list[i].recipient)
return (ENOMEM);
- (void) strcpy(__subscriptions_list[i].recipient,ptr);
+ (void) strcpy(__subscriptions_list[i].recipient,ptr2);
ptr += strlen(ptr)+1;
}