This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hi All
I am calling a function x within strcpy as follows
strcpy(a,x("sample text","default text"));
x is defined as follows
char * x(char *m, char *n) { char *return_val=NULL; if (check m is in database) return_val=m; else return_val=n; return(return_val); } This causes the array a to have a corrupted string. The string is either m or n but with illegal characters appended.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |