3 ms·
char cannot legally represent EOF (as you point out). This doesn't really have anything to do with ARM, though; for instance, the ARM compiler I use has command
by kabdib 3y ago
char cannot legally represent EOF (as you point out). This doesn't really have anything to do with ARM, though; for instance, the ARM compiler I use has command-line options and pragmas that control whether char is signed or unsigned. Char is just too small.
The type of 'out' is a different type than ssize_t, which may not matter for the practical ranges involved in parsing a file, but it certainly a bad sign.
Writes to memory it doesn't own if maxlen == 0 (unlikely, but who knows?)
Additionally: calling strchr on every input character is crazy. Frankly, the same applies to fgetc.