From 53943a002265d8e2b6a887eaa497a01840675693 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 2 May 2000 16:10:04 +0000 Subject: 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. --- lib/printf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/printf.c b/lib/printf.c index 64fcf72..a668aea 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) -- cgit v1.2.3