Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 #include <string.h>
- 2 #include <stdio.h>
- 3 #include <stdlib.h>
- 4
- 5 int main()
- 6 {
- 7 char *buf = (char*)malloc(sizeof(char)*2000);
- 8 char tmp[256];
- 9 strcpy (tmp, "test");
- 10 printf ("tmp: %sn", tmp);
- 11 strncat (buf, tmp, strlen(tmp));
- 12 printf ("buf: %sn", buf);
- 13 }
- tmp: test
- buf: test
- 153 char *inbuf = (char*)malloc(sizeof(char)*2000);
- 154 char *outbuf = (char*)malloc(sizeof(char)*2000);
- 155 char *oldinbuf = (char*)malloc(sizeof(char)*2000);
- 156 char *errbuf = (char*)malloc(sizeof(char)*2000);
- 157 memset (inbuf, '