classic-ui: fix small buffer overflows when checking strlen against MAX_INPUT_BUFFER #5663

Wrong strlen check against MAX_INPUT_BUFFER without
taking '\0' into account fixed.

Refs: #5663
whatthecommit: just shoot me