10.02.2019, 03:20
Use strlen to get the string length of the input, and create a condition to check it against the number 4. If it exceeds 4 characters, then show your error dialog. Else, proceed with your main function. Do note that strlen will also count spaces, punctuation and other symbols in its calculation.