summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/vsprintf.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 1d82adc733..237aab0c02 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -373,12 +373,21 @@ static char *pointer(const char *fmt, char *buf, const char *end, const void *pt
return raw_pointer(buf, end, ptr, field_width, precision, flags);
}
+static char *errno_string(char *buf, const char *end, int field_width, int precision, int flags)
+{
+ return string(buf, end, strerror(errno), field_width, precision, flags);
+}
#else
static char *pointer(const char *fmt, char *buf, const char *end, const void *ptr,
int field_width, int precision, int flags)
{
return raw_pointer(buf, end, ptr, field_width, precision, flags);
}
+
+static char *errno_string(char *buf, const char *end, int field_width, int precision, int flags)
+{
+ return buf;
+}
#endif
/**
@@ -569,6 +578,10 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
case 'u':
break;
+ case 'm':
+ str = errno_string(str, end, field_width, precision, flags);
+ continue;
+
default:
if (str < end)
*str = '%';