From a4e6595032838a7260425f35f0dd045a1126a9af Mon Sep 17 00:00:00 2001 From: George Koehler Date: Mon, 18 Dec 2017 21:17:42 -0500 Subject: [PATCH] Remove '\0' from output. Fix a compiler warning. Don't output '\0' in "@@FINISHED\0". Cast code to unsigned int. This helps platforms with 16-bit int, by doing only the low 16 bits of the bitwise-and. It also removes the "(warning) conversion of long to pointer loses accuracy". --- tests/plat/lib/test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/plat/lib/test.c b/tests/plat/lib/test.c index 426f9944a..6df3ee7d5 100644 --- a/tests/plat/lib/test.c +++ b/tests/plat/lib/test.c @@ -5,7 +5,7 @@ void finished(void) { static const char s[] = "@@FINISHED\n"; - write(1, s, sizeof(s)); + write(1, s, sizeof(s)-1); _exit(0); } @@ -16,7 +16,7 @@ void writehex(uint32_t code) do { - *--p = "0123456789abcdef"[code & 0xf]; + *--p = "0123456789abcdef"[(unsigned int)code & 0xf]; code >>= 4; } while (code > 0);