4 ms·
> strncpy() isn't dangerous Suppose the C specification said that string constants are automatically null terminated unless they are a certain size that is pla
by jancsika 5y ago
> strncpy() isn't dangerous
Suppose the C specification said that string constants are automatically null terminated unless they are a certain size that is platform-dependent. At that given size the null is not added. (And let's say above that size there's a compiler error. Let's also say there's a pragma for telling the compiler you want a bigger limit on the maximum string constant size.)
Would that behavior be dangerous in your opinion?