summaryrefslogtreecommitdiff
path: root/sort-dctrl
diff options
context:
space:
mode:
authorAntti-Juhani Kaijanaho <ajk@debian.org>2008-07-05 13:37:37 +0300
committerAntti-Juhani Kaijanaho <ajk@debian.org>2008-07-05 15:51:48 +0300
commitf35dc6d61bd6b5a4c661c0d31a43a46ad5f555a9 (patch)
tree21b9db60e3f2b6fdc68d970eca1385da51ecfe66 /sort-dctrl
parent0314f5e77a0bc238795008f74f7b2e5fd2c72e06 (diff)
downloaddctrl-tools-f35dc6d61bd6b5a4c661c0d31a43a46ad5f555a9.tar.gz
msg.[ch] (and others): allow the message functions to handle format strings
There are some places in the code where it would simplify both the code and the translations to have message strings be printf-formatted. This change changes the message function interfaces so that they can take a variable number of arguments. This required changes at all call sites. At the same time, the key logic of the message functions is moved out of the headers, leaving only the "shall we output this" test for inlining. Signed-off-by: Antti-Juhani Kaijanaho <ajk@debian.org>
Diffstat (limited to 'sort-dctrl')
-rw-r--r--sort-dctrl/sort-dctrl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sort-dctrl/sort-dctrl.c b/sort-dctrl/sort-dctrl.c
index 95876e4..279d593 100644
--- a/sort-dctrl/sort-dctrl.c
+++ b/sort-dctrl/sort-dctrl.c
@@ -1,5 +1,5 @@
/* dctrl-tools - Debian control file inspection tools
- Copyright © 2004, 2005, 2006, 2007 Antti-Juhani Kaijanaho
+ Copyright © 2004, 2005, 2006, 2007, 2008 Antti-Juhani Kaijanaho
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -84,8 +84,8 @@ static error_t parse_opt (int key, char * arg, struct argp_state * state)
key.type = FT_VERSION;
break;
default:
- message(L_FATAL, _("invalid key flag"),
- 0);
+ message(L_FATAL, 0,
+ _("invalid key flag"));
fail();
}
}
@@ -98,7 +98,7 @@ static error_t parse_opt (int key, char * arg, struct argp_state * state)
int ll = str2loglevel(arg);
if (ll < 0)
{
- message(L_FATAL, _("no such log level"), arg);
+ message(L_FATAL, 0, _("no such log level '%s'"), arg);
fail();
}
set_loglevel(ll);
@@ -114,7 +114,7 @@ static error_t parse_opt (int key, char * arg, struct argp_state * state)
{
char const * s;
if (args->num_fnames >= MAX_FNAMES) {
- message(L_FATAL, _("too many file names"), 0);
+ message(L_FATAL, 0, _("too many file names"));
fail();
}
s = strdup(arg);