home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / text / hyper / ADtoHT2_0.lha / MyLib.lha / string / strcat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-05  |  448 b   |  42 lines

  1. #include <string.h>
  2.  
  3. /************************************************************************/
  4.  
  5. #undef strcat
  6.  
  7. #if defined(__GNUC__) && defined(mc68000)
  8.  
  9. asm("
  10.     .globl    _strcat
  11. _strcat:    
  12.     movml    sp@(4:W),d0/a0
  13.     movel    d0,a1
  14. L2:    tstb    a1@+
  15.     jne    L2
  16.     subqw    #1,a1
  17. L1:    moveb    a0@+,a1@+
  18.     jne    L1
  19.     rts
  20. ");
  21.  
  22. #else
  23.  
  24. char *strcat(char *s1, const char *s2)
  25.  
  26.   char *s;
  27.  
  28.   s=s1;
  29.   while(*s++)
  30.     ;
  31.  
  32.   --s;
  33.   
  34.   while((*s++=*s2++))
  35.     ;
  36.  
  37.   return s1;
  38. }
  39.  
  40. #endif
  41.