diff options
Diffstat (limited to 'apps/iap.c')
-rw-r--r-- | apps/iap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/iap.c b/apps/iap.c index 51f5e5900b..592bbdbbf8 100644 --- a/apps/iap.c +++ b/apps/iap.c | |||
@@ -495,6 +495,7 @@ void iap_handlepkt(void) | |||
495 | unsigned char data[70] = {0x04, 0x00, 0xFF}; | 495 | unsigned char data[70] = {0x04, 0x00, 0xFF}; |
496 | struct mp3entry id3; | 496 | struct mp3entry id3; |
497 | int fd; | 497 | int fd; |
498 | size_t len; | ||
498 | long tracknum = (signed long)serbuf[4] << 24 | | 499 | long tracknum = (signed long)serbuf[4] << 24 | |
499 | (signed long)serbuf[5] << 16 | | 500 | (signed long)serbuf[5] << 16 | |
500 | (signed long)serbuf[6] << 8 | serbuf[7]; | 501 | (signed long)serbuf[6] << 8 | serbuf[7]; |
@@ -520,16 +521,16 @@ void iap_handlepkt(void) | |||
520 | switch(serbuf[3]) | 521 | switch(serbuf[3]) |
521 | { | 522 | { |
522 | case 0x20: | 523 | case 0x20: |
523 | strncpy((char *)&data[3], id3.title, 64); | 524 | len = strlcpy((char *)&data[3], id3.title, 64); |
524 | iap_send_pkt(data, 4+strlen(id3.title)); | 525 | iap_send_pkt(data, 4+len); |
525 | break; | 526 | break; |
526 | case 0x22: | 527 | case 0x22: |
527 | strncpy((char *)&data[3], id3.artist, 64); | 528 | len = strlcpy((char *)&data[3], id3.artist, 64); |
528 | iap_send_pkt(data, 4+strlen(id3.artist)); | 529 | iap_send_pkt(data, 4+len); |
529 | break; | 530 | break; |
530 | case 0x24: | 531 | case 0x24: |
531 | strncpy((char *)&data[3], id3.album, 64); | 532 | len = strlcpy((char *)&data[3], id3.album, 64); |
532 | iap_send_pkt(data, 4+strlen(id3.album)); | 533 | iap_send_pkt(data, 4+len); |
533 | break; | 534 | break; |
534 | } | 535 | } |
535 | break; | 536 | break; |