summaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authornicm <nicm>2017-01-30 21:41:17 +0000
committernicm <nicm>2017-01-30 21:41:17 +0000
commit3408595f77920764bf6c4c313a0abc6a1cfb8048 (patch)
tree1e2c21925847bd18641b589ea4028c78187a0212 /options.c
parentb6099f31ead647749574c36b34619db940587fc7 (diff)
When a flag option is used in a format, it should use the number form
not string.
Diffstat (limited to 'options.c')
-rw-r--r--options.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/options.c b/options.c
index 37263b53..4de25937 100644
--- a/options.c
+++ b/options.c
@@ -325,7 +325,7 @@ options_isstring(struct options_entry *o)
}
const char *
-options_tostring(struct options_entry *o, int idx)
+options_tostring(struct options_entry *o, int idx, int numeric)
{
static char s[1024];
const char *tmp;
@@ -355,7 +355,10 @@ options_tostring(struct options_entry *o, int idx)
tmp = attributes_tostring(o->number);
break;
case OPTIONS_TABLE_FLAG:
- tmp = (o->number ? "on" : "off");
+ if (numeric)
+ xsnprintf(s, sizeof s, "%lld", o->number);
+ else
+ tmp = (o->number ? "on" : "off");
break;
case OPTIONS_TABLE_CHOICE:
tmp = o->tableentry->choices[o->number];