Commit | Line | Data |
---|---|---|
c906108c | 1 | #include <stdio.h> |
085dd6e6 JM |
2 | #include <stdlib.h> |
3 | #include <string.h> | |
4 | ||
dedad4e3 PA |
5 | #include "../lib/unbuffer_output.c" |
6 | ||
c906108c SS |
7 | char buf[100]; |
8 | char bigbuf[1000]; | |
9 | char * s; | |
10 | ||
085dd6e6 | 11 | char * str_func1(char *s1) |
c906108c SS |
12 | { |
13 | printf("first string arg is: %s\n", s1); | |
14 | strcpy(bigbuf, s1); | |
15 | return bigbuf; | |
16 | } | |
17 | ||
085dd6e6 JM |
18 | char * str_func( |
19 | char * s1, | |
20 | char * s2, | |
21 | char * s3, | |
22 | char * s4, | |
23 | char * s5, | |
24 | char * s6, | |
25 | char * s7) | |
c906108c SS |
26 | { |
27 | printf("first string arg is: %s\n", s1); | |
28 | printf("second string arg is: %s\n", s2); | |
29 | printf("third string arg is: %s\n", s3); | |
30 | printf("fourth string arg is: %s\n", s4); | |
31 | printf("fifth string arg is: %s\n", s5); | |
32 | printf("sixth string arg is: %s\n", s6); | |
33 | printf("seventh string arg is: %s\n", s7); | |
34 | strcpy(bigbuf, s1); | |
35 | strcat(bigbuf, s2); | |
36 | strcat(bigbuf, s3); | |
37 | strcat(bigbuf, s4); | |
38 | strcat(bigbuf, s5); | |
39 | strcat(bigbuf, s6); | |
40 | strcat(bigbuf, s7); | |
41 | return bigbuf; | |
42 | } | |
43 | ||
0f71a2f6 JM |
44 | char * |
45 | link_malloc () | |
46 | { | |
47 | return (char*) malloc (1); | |
48 | } | |
c906108c | 49 | |
085dd6e6 | 50 | int main() |
c906108c | 51 | { |
dedad4e3 PA |
52 | gdb_unbuffer_output (); |
53 | ||
c906108c SS |
54 | s = &buf[0]; |
55 | strcpy(buf, "test string"); | |
56 | str_func("abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx", "yz12"); | |
57 | str_func1("abcd"); | |
085dd6e6 | 58 | return 0; |
c906108c SS |
59 | } |
60 |