diff --git a/Makefile b/Makefile index fb683d1..ddecf90 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ all: - @objfw-compile -o scrypt-pwgen *.m + @objfw-compile -Werror -o scrypt-pwgen *.m clean: rm -f *.o *~ scrypt-pwgen diff --git a/ScryptPWGen.m b/ScryptPWGen.m index bf11bdc..65198ff 100644 --- a/ScryptPWGen.m +++ b/ScryptPWGen.m @@ -117,10 +117,10 @@ showHelp(OFStream *output, bool verbose) @try { generator.length = (size_t)[lengthStr decimalValue]; - } @catch (OFInvalidArgumentException *e) { - invalid = true; } @catch (OFInvalidFormatException *e) { invalid = true; + } @catch (OFOutOfRangeException *e) { + invalid = true; } if (invalid) { @@ -136,7 +136,7 @@ showHelp(OFStream *output, bool verbose) prompt = [OFString stringWithFormat: @"Passphrase for site \"%@\": ", generator.site]; passphrase = getpass( - [prompt cStringWithEncoding: [OFSystemInfo native8BitEncoding]]); + [prompt cStringWithEncoding: [OFLocalization encoding]]); @try { if (_repeat) { char *passphraseCopy = of_strdup(passphrase); @@ -146,7 +146,7 @@ showHelp(OFStream *output, bool verbose) @try { of_string_encoding_t encoding = - [OFSystemInfo native8BitEncoding]; + [OFLocalization encoding]; prompt = [OFString stringWithFormat: @"Repeat passphrase for site \"%@\": ",