The character classification functions in <ctype.h> are designed to classify characters returned by <stdio.h> getchar() and friends, which return characters as signed integers in the range 0 to 255 or EOF. The behavior of the ctype functions is undefined if they are passed a value outside of that range, which may happen if they are passed a char-typed value and the system's char type is signed. <ccan/str/str.h> defines some inline utility functions that perform the necessary cast to coerce a char-typed argument into the allowed value range. Call these wrappers instead of the bare ctype functions when classifying char-typed characters. Changelog-None
76 KiB
76 KiB