summaryrefslogtreecommitdiff
path: root/src/cam/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cam/options.cpp')
-rw-r--r--src/cam/options.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cam/options.cpp b/src/cam/options.cpp
index 172d40f7..b80d361e 100644
--- a/src/cam/options.cpp
+++ b/src/cam/options.cpp
@@ -382,8 +382,8 @@ OptionsParser::Options OptionsParser::parse(int argc, char **argv)
* Allocate short and long options arrays large enough to contain all
* options.
*/
- char shortOptions[options_.size() * 3 + 2] = {};
- struct option longOptions[options_.size() + 1] = {};
+ char shortOptions[options_.size() * 3 + 2];
+ struct option longOptions[options_.size() + 1];
unsigned int ids = 0;
unsigned int idl = 0;
@@ -419,6 +419,9 @@ OptionsParser::Options OptionsParser::parse(int argc, char **argv)
}
}
+ shortOptions[ids] = '\0';
+ memset(&longOptions[idl], 0, sizeof(longOptions[idl]));
+
opterr = 0;
while (true) {