Improved testing for 0-strings in the routine "mycat".

This commit is contained in:
ceriel 1986-12-11 17:04:40 +00:00
parent e98c02b831
commit 9e6fe01229

View 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,"+");