projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e019c4b
)
main: always ensure defaults when printing
author
Brian Norris
<banorris@uci.edu>
Sun, 4 Nov 2012 01:14:19 +0000
(18:14 -0700)
committer
Brian Norris
<banorris@uci.edu>
Sun, 4 Nov 2012 01:14:19 +0000
(18:14 -0700)
If one or more arguments have been parsed by the time we print a help
message, we may print the wrong defaults. Fix: always reset to defaults
before printing.
main.cc
patch
|
blob
|
history
diff --git
a/main.cc
b/main.cc
index fc1b2779daa657ae6460293da49d29a5c95ec21d..8a17a18e50d718324662e178f6496dec58fbbe00 100644
(file)
--- a/
main.cc
+++ b/
main.cc
@@
-23,6
+23,9
@@
static void param_defaults(struct model_params * params) {
}
static void print_usage(struct model_params *params) {
+ /* Reset defaults before printing */
+ param_defaults(params);
+
printf(
"Usage: <program name> [MC_OPTIONS] -- [PROGRAM ARGUMENTS]\n"
"\n"