File: CatString3.c

package info (click to toggle)
asclassic 1.1b-26
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,828 kB
  • ctags: 2,019
  • sloc: ansic: 21,403; makefile: 407; sh: 276
file content (22 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#include <string.h>


/************************************************************************
 *
 * Concatentates 3 strings
 *
 *************************************************************************/
char CatS[256];

char *CatString3(char *a, char *b, char *c)
{
  if (strlen(a)+strlen(b)+strlen(c) > 255)
    {
      return NULL;
    }
  strcpy(CatS, a);
  strcat(CatS, b);
  strcat(CatS, c);
  return CatS;
}