summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-07-05 08:36:40 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-07-05 08:36:40 +0200
commit86d04e087b81dc4d19aa72ec4172532cd5d146c4 (patch)
tree5cb2c1c7e9949a094496240b0b70a95515a920bd
parentc65257f961a75d8738ffb114163a1992061fb6a6 (diff)
downloadnthash-86d04e087b81dc4d19aa72ec4172532cd5d146c4.tar.gz
nthash-86d04e087b81dc4d19aa72ec4172532cd5d146c4.tar.zst
be more verbose about problematic characters in input0.1.1
-rw-r--r--nthash.c4
1 files changed, 4 insertions, 0 deletions
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;
}