diff options
author | John Wiegley <johnw@newartisans.com> | 2012-05-07 01:54:20 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-05-07 01:54:20 -0500 |
commit | e5c4c20cbb29f0c73dde26ba71df33b400b1d9d4 (patch) | |
tree | 6eacdbef8adddf490bf83a6142da8e917ea8443a /src/option.h | |
parent | 6a0daf634fa76ba61ea79e55e4d3f213aa27e306 (diff) | |
download | fork-ledger-e5c4c20cbb29f0c73dde26ba71df33b400b1d9d4.tar.gz fork-ledger-e5c4c20cbb29f0c73dde26ba71df33b400b1d9d4.tar.bz2 fork-ledger-e5c4c20cbb29f0c73dde26ba71df33b400b1d9d4.zip |
Made some code in option.h a bit safer
Diffstat (limited to 'src/option.h')
-rw-r--r-- | src/option.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/option.h b/src/option.h index 772f2b01..b0d4e0f0 100644 --- a/src/option.h +++ b/src/option.h @@ -68,7 +68,7 @@ public: option_t(const char * _name, const char _ch = '\0') : name(_name), name_len(std::strlen(name)), ch(_ch), handled(false), parent(NULL), value(), - wants_arg(name[name_len - 1] == '_') { + wants_arg(name_len > 0 ? name[name_len - 1] == '_' : false) { DEBUG("option.names", "Option: " << name); TRACE_CTOR(option_t, "const char *, const char"); } |