Content deleted Content added
Reverted good faith edits by 2601:1C0:D:3E46:A02A:2259:E628:EFF (talk): Sizeof in fact does work on arrays (and is required to not perform an implicit array-to-pointer conversion). Furthermore, with your changes the code would potentially apply strlen on a character array without NUL termination. |
Revert to revision 993638700 dated 2020-12-11 17:51:34 by Pelirodri1248 using popups |
||
Line 35:
// Copy input without exceeding the length of the destination.
strncpy(str, input,
// If strlen(input) >= sizeof(str) then strncpy won't null terminate.
|