diff options
Diffstat (limited to 'src/util/getopt_helpers.c')
-rw-r--r-- | src/util/getopt_helpers.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c index 32cce65dd..661521c45 100644 --- a/src/util/getopt_helpers.c +++ b/src/util/getopt_helpers.c | |||
@@ -108,9 +108,10 @@ format_help (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, | |||
108 | (void) value; | 108 | (void) value; |
109 | if (NULL != about) | 109 | if (NULL != about) |
110 | { | 110 | { |
111 | printf ("%s\n%s\n", ctx->binaryOptions, gettext (about)); | 111 | printf ("%s\n%s\n", |
112 | printf (_ | 112 | ctx->binaryOptions, |
113 | ("Arguments mandatory for long options are also mandatory for short options.\n")); | 113 | gettext (about)); |
114 | printf (_("Arguments mandatory for long options are also mandatory for short options.\n")); | ||
114 | } | 115 | } |
115 | i = 0; | 116 | i = 0; |
116 | opt = ctx->allOptions; | 117 | opt = ctx->allOptions; |
@@ -549,11 +550,13 @@ set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, | |||
549 | const char *value) | 550 | const char *value) |
550 | { | 551 | { |
551 | unsigned long long *val = scls; | 552 | unsigned long long *val = scls; |
553 | char dummy[2]; | ||
552 | 554 | ||
553 | (void) ctx; | 555 | (void) ctx; |
554 | if (1 != SSCANF (value, | 556 | if (1 != SSCANF (value, |
555 | "%llu", | 557 | "%llu%1s", |
556 | val)) | 558 | val, |
559 | dummy)) | ||
557 | { | 560 | { |
558 | FPRINTF (stderr, | 561 | FPRINTF (stderr, |
559 | _("You must pass a number to the `%s' option.\n"), | 562 | _("You must pass a number to the `%s' option.\n"), |
@@ -746,6 +749,7 @@ set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, | |||
746 | const char *value) | 749 | const char *value) |
747 | { | 750 | { |
748 | unsigned int *val = scls; | 751 | unsigned int *val = scls; |
752 | char dummy[2]; | ||
749 | 753 | ||
750 | (void) ctx; | 754 | (void) ctx; |
751 | if('-' == *value) | 755 | if('-' == *value) |
@@ -756,8 +760,9 @@ set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, | |||
756 | return GNUNET_SYSERR; | 760 | return GNUNET_SYSERR; |
757 | } | 761 | } |
758 | if (1 != SSCANF (value, | 762 | if (1 != SSCANF (value, |
759 | "%u", | 763 | "%u%1s", |
760 | val)) | 764 | val, |
765 | dummy)) | ||
761 | { | 766 | { |
762 | FPRINTF (stderr, | 767 | FPRINTF (stderr, |
763 | _("You must pass a number to the `%s' option.\n"), | 768 | _("You must pass a number to the `%s' option.\n"), |
@@ -820,11 +825,13 @@ set_uint16 (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, | |||
820 | { | 825 | { |
821 | uint16_t *val = scls; | 826 | uint16_t *val = scls; |
822 | unsigned int v; | 827 | unsigned int v; |
828 | char dummy[2]; | ||
823 | 829 | ||
824 | (void) ctx; | 830 | (void) ctx; |
825 | if (1 != SSCANF (value, | 831 | if (1 != SSCANF (value, |
826 | "%u", | 832 | "%u%1s", |
827 | &v)) | 833 | &v, |
834 | dummy)) | ||
828 | { | 835 | { |
829 | FPRINTF (stderr, | 836 | FPRINTF (stderr, |
830 | _("You must pass a number to the `%s' option.\n"), | 837 | _("You must pass a number to the `%s' option.\n"), |