diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-01-15 05:57:14 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-01-15 05:57:14 +0000 |
commit | a984011814b3de3c4a300c364893cd6c6cc8ec05 (patch) | |
tree | 0f20a4361de5db8895c77ea5d9cea668d86ecc47 | |
parent | 89dfec02d89979935568ff6028366eec1faf3380 (diff) | |
download | tor-a984011814b3de3c4a300c364893cd6c6cc8ec05.tar.gz tor-a984011814b3de3c4a300c364893cd6c6cc8ec05.zip |
r17623@catbus: nickm | 2008-01-15 00:22:04 -0500
bulletproof option_get_canonical_name()
svn:r13135
-rw-r--r-- | src/or/config.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index b09e3c3191..8b34dec156 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1683,12 +1683,13 @@ option_is_recognized(const char *key) return (var != NULL); } -/** Return the canonical name of a configuration option. */ +/** Return the canonical name of a configuration option, or NULL + * if no such option exists. */ const char * option_get_canonical_name(const char *key) { config_var_t *var = config_find_option(&options_format, key); - return var->name; + return var ? var->name : NULL; } /** Return a canonicalized list of the options assigned for key. |