From 62a7b2c54013b0f7e312cb439ce865cd24884bd8 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 8 Aug 2002 05:27:37 +0000 Subject: Avoid bad things happening on macro expansion... -Erik --- libc/unistd/swab.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libc/unistd') diff --git a/libc/unistd/swab.c b/libc/unistd/swab.c index 41845d4cb..70ea464c2 100644 --- a/libc/unistd/swab.c +++ b/libc/unistd/swab.c @@ -11,8 +11,13 @@ void swab (const void *source, void *dest, ssize_t count) { const unsigned short *from = source, *from_end = from + (count >> 1); + unsigned short junk; unsigned short *to = dest; - while (from < from_end) - *to++ = bswap_16 (*from++); + while (from < from_end) { + /* Don't put '*from++'into the bswap_16() macros + * or mad things will happen on macro expansion */ + junk=*from++; + *to++ = bswap_16 (junk); + } } -- cgit v1.2.3