Improved testing for 0-strings in the routine "mycat".
authorceriel <none@none>
Thu, 11 Dec 1986 17:04:40 +0000 (17:04 +0000)
committerceriel <none@none>
Thu, 11 Dec 1986 17:04:40 +0000 (17:04 +0000)
mach/proto/ncg/compute.c

index c86e073..d023fd8 100644 (file)
@@ -86,8 +86,8 @@ string salloc(),strcpy(),strcat();
 string mycat(s1,s2) register string s1,s2; {
        register string s;
 
-       if (s1==0) return(s2);
-       if (s2==0) return(s1);
+       if (s1==0 || *s1=='\0') return(s2);
+       if (s2==0 || *s2=='\0') return(s1);
        s=salloc(strlen(s1)+strlen(s2)+1);
        strcpy(s,s1);
        strcat(s,"+");