3 ms·
> Yes, it can. I don't think so. If it could, then this code would reliably crash: char *mystr = strdup (oldstr); if (mystr) *mystr = 0; // Tr
by lelanthran 1y ago
> Yes, it can.
I don't think so. If it could, then this code would reliably crash:
char *mystr = strdup (oldstr);
if (mystr)
*mystr = 0; // Truncate string
That never crashes.
- menaerus 1y agohttps://godbolt.org/z/aPcr1bfPe https://godbolt.org/z/aPcr1bfPe