Re: strcpy and strcat seem to lead to a stack overflow

2022-02-23 Thread Jonathan Wakely via Gcc
On Tue, 22 Feb 2022 at 21:02, Emile Michel Hobo wrote: > I hope you can fix this. There is nothing to fix, strcpy and strcat work exactly as required by the C standard, and that isn't going to change. In any case, it's off-topic on this mailing list because those functions are defined in the C st

Re: strcpy and strcat seem to lead to a stack overflow

2022-02-23 Thread lego12239--- via Gcc
On Tue, Feb 22, 2022 at 10:01:47PM +0100, Emile Michel Hobo via Gcc wrote: > Dear developers: > > I find it counterintuitive that if I repeatedly reset a variable by using > strcpy with an empty string "" to that variable and then us strcat to add > characters to that variable that that seems to

Re: strcpy and strcat seem to lead to a stack overflow

2022-02-22 Thread Patrick McGehearty
You may be thinking of string capabilities in some other language. Selected from the Linux man pages for these glibc functions: strcpy:    char *strcpy(char *dest, const char *src);    The  strcpy()  function  copies the string pointed to by src, including    the terminating null by

strcpy and strcat seem to lead to a stack overflow

2022-02-22 Thread Emile Michel Hobo via Gcc
Dear developers: I find it counterintuitive that if I repeatedly reset a variable by using strcpy with an empty string "" to that variable and then us strcat to add characters to that variable that that seems to lead to a stack overflow. I would expect strcpy to first free the variable, then ma