summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2015-03-09 07:50:07 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2015-03-09 16:14:18 -0500
commit865f10d16ed177b579d627796a56cbbd4dea0f88 (patch)
tree33c289e71a01895192db64f65cc3483966508d82
parentcpukit/libdl/rtl-mdreloc-m32r.c: Add parentheses per Chris' suggestion (diff)
downloadrtems-865f10d16ed177b579d627796a56cbbd4dea0f88.tar.bz2
cpukit/libcrypt/misc.c: Conditionally correct 16-bit unclean code
-rw-r--r--cpukit/libcrypt/misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/libcrypt/misc.c b/cpukit/libcrypt/misc.c
index 9f2c13e8c7..9ca26d46e0 100644
--- a/cpukit/libcrypt/misc.c
+++ b/cpukit/libcrypt/misc.c
@@ -52,7 +52,11 @@ b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp
uint32_t w;
int i;
+#if defined(__rtems__)
w = (B2 << 16) | (B1 << 8) | B0;
+#else
+ w = ((uint32_t)B2 << 16) | ((uint32_t)B1 << 8) | B0;
+#endif
for (i = 0; i < n; i++) {
**cp = itoa64[w&0x3f];
(*cp)++;