iOS: A few code modernizations

This commit is contained in:
Jonathan Schleifer 2017-11-26 20:19:07 +01:00
parent ccc0706caa
commit f886262722
No known key found for this signature in database
GPG key ID: 28D65178B37F33E3
8 changed files with 46 additions and 33 deletions

View file

@ -105,7 +105,7 @@ showHelp(OFStream *output, bool verbose)
}
}
if ([[optionsParser remainingArguments] count] != 1) {
if (optionsParser.remainingArguments.count != 1) {
showHelp(of_stderr, false);
[OFApplication terminateWithStatus: 1];
@ -114,13 +114,13 @@ showHelp(OFStream *output, bool verbose)
id <PasswordGenerator> generator = (_legacy
? [LegacyPasswordGenerator generator]
: [NewPasswordGenerator generator]);
generator.site = [[optionsParser remainingArguments] firstObject];
generator.site = optionsParser.remainingArguments.firstObject;
if (lengthString != nil) {
bool invalid = false;
@try {
generator.length = (size_t)[lengthString decimalValue];
generator.length = (size_t)lengthString.decimalValue;
} @catch (OFInvalidFormatException *e) {
invalid = true;
} @catch (OFOutOfRangeException *e) {
@ -190,7 +190,7 @@ showHelp(OFStream *output, bool verbose)
of_explicit_memset(passphrase, 0, strlen(passphrase));
if (keyfile != nil)
of_explicit_memset([keyfile items], 0, [keyfile count]);
of_explicit_memset(keyfile.items, 0, keyfile.count);
}
[OFApplication terminate];