From 86d04e087b81dc4d19aa72ec4172532cd5d146c4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 5 Jul 2013 08:36:40 +0200 Subject: be more verbose about problematic characters in input --- nthash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nthash.c b/nthash.c index 16afe60..6696636 100644 --- a/nthash.c +++ b/nthash.c @@ -22,6 +22,10 @@ int main(int argc, char **argv) { for (i = 0; i < done; i++) { if (buffer[i] == 0xa) fprintf(stderr, "Warning: Password contains line break!\n"); + else if (buffer[i] < 0x20 || buffer[i] == 0x7f) + fprintf(stderr, "Warning: Password contains non-printable control character 0x%x!\n", buffer[i]); + else if (buffer[i] > 0x7f) + fprintf(stderr, "Warning: Password contains non-ASCII character 0x%x!\n", buffer[i]); buffernull[i*2] = buffer[i]; buffernull[i*2+1] = 0; } -- cgit v1.2.3-54-g00ecf