May it happen that the input is not NULL-terminated? If not, a simple `strcmp()` would do the job. `strnlen()` might not be available on some platform.