2 ms·
> There is also the mangle-use-repair choice. Which is problematic for thread safety and depending on the source of the string (constant) may not be possible.
by account42 6y ago
> There is also the mangle-use-repair choice.
Which is problematic for thread safety and depending on the source of the string (constant) may not be possible.
- souprock 6y agoIt's not problematic. C programmers are expected to avoid screwing that up. C is a full-power language. If available, strdupa() would be a fine way to get a suitable local copy of the string. Commonly though, the programmer knows that there will not be threads and can make the string non-constant.