Improved testing for 0-strings in the routine "mycat".
This commit is contained in:
parent
e98c02b831
commit
9e6fe01229
1 changed files with 2 additions and 2 deletions
|
@ -86,8 +86,8 @@ string salloc(),strcpy(),strcat();
|
||||||
string mycat(s1,s2) register string s1,s2; {
|
string mycat(s1,s2) register string s1,s2; {
|
||||||
register string s;
|
register string s;
|
||||||
|
|
||||||
if (s1==0) return(s2);
|
if (s1==0 || *s1=='\0') return(s2);
|
||||||
if (s2==0) return(s1);
|
if (s2==0 || *s2=='\0') return(s1);
|
||||||
s=salloc(strlen(s1)+strlen(s2)+1);
|
s=salloc(strlen(s1)+strlen(s2)+1);
|
||||||
strcpy(s,s1);
|
strcpy(s,s1);
|
||||||
strcat(s,"+");
|
strcat(s,"+");
|
||||||
|
|
Loading…
Add table
Reference in a new issue