summaryrefslogtreecommitdiff
path: root/libpiano/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-05-28 18:28:17 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-05-28 18:28:17 +0200
commit343270e6ad3f418a68a4feb220522018e98f458c (patch)
tree3020a75b01614cce51f54023093de9b9b4e910be /libpiano/src
parentd8648e1896aa2c9d6bf2273712ede9db01aac917 (diff)
downloadpianobar-windows-343270e6ad3f418a68a4feb220522018e98f458c.tar.gz
pianobar-windows-343270e6ad3f418a68a4feb220522018e98f458c.tar.bz2
pianobar-windows-343270e6ad3f418a68a4feb220522018e98f458c.zip
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...
Diffstat (limited to 'libpiano/src')
-rw-r--r--libpiano/src/crypt.c2
1 files changed, 1 insertions, 1 deletions
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++;
}