diff options
author | Martin Mares <mj@ucw.cz> | 2000-05-02 16:10:04 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2000-05-02 16:10:04 +0000 |
commit | 53943a002265d8e2b6a887eaa497a01840675693 (patch) | |
tree | 66897b24d24a3840d880c11f89a208981c23bf9e /lib | |
parent | 85368cd4b7244535f6ce56a27f6d22ddfa2bf4e6 (diff) |
Defined format specifier `%M' which behaves as `%m', but takes the
error code as an argument.
Use it in socket hooks where we really shouldn't rely on errno containing
the right value or even existing.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/printf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/printf.c b/lib/printf.c index 64fcf728..a668aeaf 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -198,6 +198,9 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args) case 'm': s = strerror(errno); goto str; + case 'M': + s = strerror(va_arg(args, int)); + goto str; case 's': s = va_arg(args, char *); if (!s) |