From: Maria Matejka Date: Tue, 16 Apr 2019 18:22:33 +0000 (+0200) Subject: Fixed printf test on android X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e164bb3747acba4726df0a79f3d4b759a00770f;p=thirdparty%2Fbird.git Fixed printf test on android --- diff --git a/lib/printf_test.c b/lib/printf_test.c index a2683d93f..61d87c100 100644 --- a/lib/printf_test.c +++ b/lib/printf_test.c @@ -33,10 +33,12 @@ t_simple(void) BSPRINTF(1, "\xff", buf, "%c", 0xff); errno = 5; - BSPRINTF(18, "Input/output error", buf, "%m"); - errno = 0; + const char *ioemsg = strerror(errno); + const int ioesize = strlen(ioemsg); + BSPRINTF(ioesize, ioemsg, buf, "%m"); - BSPRINTF(18, "Input/output error", buf, "%M", 5); + errno = 0; + BSPRINTF(ioesize, ioemsg, buf, "%M", 5); BSPRINTF(11, "TeSt%StRiNg", buf, "%s", "TeSt%StRiNg");