From 343270e6ad3f418a68a4feb220522018e98f458c Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <PromyLOPh@lavabit.com>
Date: Thu, 28 May 2009 18:28:17 +0200
Subject: piano: Fix BytesToInts

This commit fixes strange "not valid utf-8" errors sent by pandora.
We're *not* generating invalid utf-8 somewhere. Implicit type casting
seems to mess things up.

See previous commit for a similar problem...
---
 libpiano/src/crypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'libpiano/src')

diff --git a/libpiano/src/crypt.c b/libpiano/src/crypt.c
index 1b59533..0cc359e 100644
--- a/libpiano/src/crypt.c
+++ b/libpiano/src/crypt.c
@@ -157,7 +157,7 @@ void PianoBytesToInts (const char *strInput, unsigned int **retArrInts,
 	while (i < strInputN) {
 		shift = 24;
 		while (shift >= 0 && i < strInputN) {
-			arrInts[i/4] |= strInput[i] << shift;
+			arrInts[i/4] |= (strInput[i] & 0xff) << shift;
 			shift -= 8;
 			i++;
 		}
-- 
cgit v1.2.3