diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-10-02 13:13:31 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-10-02 13:13:31 +0200 |
commit | 283a6f83f90a10175ffa6b5acbb895298223b48d (patch) | |
tree | ed2af6dc472c9bf64b1b81c4528fdc776246a1a3 /ci.c | |
parent | 2fc075f5f93d0207afc27e88659cedc66d392204 (diff) | |
download | vdr-283a6f83f90a10175ffa6b5acbb895298223b48d.tar.gz vdr-283a6f83f90a10175ffa6b5acbb895298223b48d.tar.bz2 |
Now skipping some funny characters sent by some CAMs at the beginning of strings
Diffstat (limited to 'ci.c')
-rw-r--r-- | ci.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.c 1.29 2005/10/02 12:51:42 kls Exp $ + * $Id: ci.c 1.30 2005/10/02 13:10:28 kls Exp $ */ #include "ci.h" @@ -92,6 +92,12 @@ static char *CopyString(int Length, const uint8_t *Data) ///< Copies the string at Data. ///< \return Returns a pointer to a newly allocated string. { + // Some CAMs send funny characters at the beginning of strings. + // Let's just skip them: + while (Length > 0 && (*Data == 0x05 || *Data == 0x96 || *Data == 0x97)) { + Length--; + Data++; + } char *s = MALLOC(char, Length + 1); strncpy(s, (char *)Data, Length); s[Length] = 0; |