From: sater Date: Thu, 9 Oct 1986 16:15:00 +0000 (+0000) Subject: empty string was returned when it was not so good. X-Git-Tag: release-5-5~5206 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=2672c87f68a27271c1cf056aa1e0d1e7d9754442;p=ack.git empty string was returned when it was not so good. --- diff --git a/mach/proto/ncg/gencode.c b/mach/proto/ncg/gencode.c index 1f84faf22..a17018202 100644 --- a/mach/proto/ncg/gencode.c +++ b/mach/proto/ncg/gencode.c @@ -84,8 +84,12 @@ string ad2str(ad) addr_t ad; { if (ad.ea_str==0) ad.ea_str=""; - if (ad.ea_off==0) - return(mystrcpy(ad.ea_str)); + if ((long)ad.ea_off==(long)0) { + if strcmp(ad.ea_str,"") + return(mystrcpy("0")); /* don't return empty string */ + else + return(mystrcpy(ad.ea_str)); + } sprintf(buf,"%s%c%ld",ad.ea_str,ad.ea_off>=0 ? '+' : ' ',(long)ad.ea_off); return(mystrcpy(buf)); }