cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

strcat.c (241B)


      1#include <string.h>
      2
      3/*
      4 * Concatenate s2 on the end of s1. s1 must be large enough.
      5 * Return s1.
      6 */
      7
      8char *strcat(char *s1, const char *s2) {
      9    char *os1 = s1;
     10    while (*s1++) ;
     11    --s1;
     12    while (*s1++ = *s2++) ;
     13    return os1;
     14}