Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.c-torture / execute / builtins / lib / strncat.c
blob290d4cf49bb472557e94bae1955957be650b84ca
1 extern void abort(void);
2 extern int inside_main;
4 typedef __SIZE_TYPE__ size_t;
6 char *
7 strncat (char *s1, const char *s2, size_t n)
9 char *dest = s1;
10 char c = '\0';
11 #ifdef __OPTIMIZE__
12 if (inside_main)
13 abort();
14 #endif
15 while (*s1) s1++;
16 c = '\0';
17 while (n > 0)
19 c = *s2++;
20 *s1++ = c;
21 if (c == '\0')
22 return dest;
23 n--;
25 if (c != '\0')
26 *s1 = '\0';
27 return dest;