diff options
author | Daniel Pinto <danielpinto52@gmail.com> | 2020-08-03 20:08:17 +0100 |
---|---|---|
committer | Daniel Pinto <danielpinto52@gmail.com> | 2020-08-03 20:08:17 +0100 |
commit | ccdd0d801ae952d4c8219eea9acdd3acfd438924 (patch) | |
tree | a62aab1be8e18804a7e9e5d7aea8a950567d1a0e /src/app/config | |
parent | 1474ab33956eefd9b75ef9a3e238ec7f855b8c7e (diff) | |
download | tor-ccdd0d801ae952d4c8219eea9acdd3acfd438924.tar.gz tor-ccdd0d801ae952d4c8219eea9acdd3acfd438924.zip |
Minor style improvements. #30045
Diffstat (limited to 'src/app/config')
-rw-r--r-- | src/app/config/config.c | 3 | ||||
-rw-r--r-- | src/app/config/or_options_st.h | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 1c6d4acd3e..23f280891b 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -4434,9 +4434,8 @@ options_init_from_torrc(int argc, char **argv) const char *v = format_line->value; // keep the same order as enum key_expiration_format const char *formats[] = { "iso8601", "timestamp" }; - const int formats_len = sizeof(formats) / sizeof(formats[0]); int format = -1; - for (int i = 0; i < formats_len; i++) { + for (unsigned i = 0; i < ARRAY_LENGTH(formats); i++) { if (!strcmp(v, formats[i])) { format = i; break; diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h index 774b476476..9d620c7b62 100644 --- a/src/app/config/or_options_st.h +++ b/src/app/config/or_options_st.h @@ -35,6 +35,12 @@ typedef enum { TCP_PROXY_PROTOCOL_HAPROXY } tcp_proxy_protocol_t; +/** Enumeration of available time formats for output of --key-expiration */ +typedef enum { + KEY_EXPIRATION_FORMAT_ISO8601 = 0, + KEY_EXPIRATION_FORMAT_TIMESTAMP +} key_expiration_format_t; + /** Configuration options for a Tor process. */ struct or_options_t { uint32_t magic_; @@ -944,10 +950,7 @@ struct or_options_t { * ed25519 identity key except from tor --keygen */ int OfflineMasterKey; - enum { - KEY_EXPIRATION_FORMAT_ISO8601 = 0, - KEY_EXPIRATION_FORMAT_TIMESTAMP - } key_expiration_format; + key_expiration_format_t key_expiration_format; enum { FORCE_PASSPHRASE_AUTO=0, |