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 fa2c7d6beb..dcdb0fbb91 100644 --- a/apps/iap.c +++ b/apps/iap.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include "tuner.h" | 43 | #include "tuner.h" |
44 | #include "ipod_remote_tuner.h" | 44 | #include "ipod_remote_tuner.h" |
45 | 45 | ||
46 | #define MAX_NAME_LENGTH 20 | ||
47 | #include "filetree.h" | 46 | #include "filetree.h" |
48 | #include "dir.h" | 47 | #include "dir.h" |
49 | 48 | ||
@@ -647,20 +646,20 @@ static void iap_handlepkt_mode4(void) | |||
647 | case 0x001A: | 646 | case 0x001A: |
648 | { | 647 | { |
649 | /* ReturnCategorizedDatabaseRecord */ | 648 | /* ReturnCategorizedDatabaseRecord */ |
650 | unsigned char data[7 + MAX_NAME_LENGTH] = | 649 | unsigned char data[7 + MAX_PATH] = |
651 | {0x04, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, | 650 | {0x04, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, |
652 | 'R', 'O', 'C', 'K', 'B', 'O', 'X', '\0'}; | 651 | 'R', 'O', 'C', 'K', 'B', 'O', 'X', '\0'}; |
653 | 652 | ||
654 | unsigned long item_offset = (serbuf[5] << 24) | (serbuf[6] << 16) | | 653 | unsigned long item_offset = (serbuf[5] << 24) | (serbuf[6] << 16) | |
655 | (serbuf[7] << 8) | serbuf[8]; | 654 | (serbuf[7] << 8) | serbuf[8]; |
656 | 655 | ||
657 | get_playlist_name(data + 7, item_offset, MAX_NAME_LENGTH); | 656 | get_playlist_name(data + 7, item_offset, MAX_PATH); |
658 | /*Remove file extension*/ | 657 | /*Remove file extension*/ |
659 | char *dot=NULL; | 658 | char *dot=NULL; |
660 | dot = (strrchr(data+7, '.')); | 659 | dot = (strrchr(data+7, '.')); |
661 | if (dot != NULL) | 660 | if (dot != NULL) |
662 | *dot = '\0'; | 661 | *dot = '\0'; |
663 | iap_send_pkt(data, sizeof(data)); | 662 | iap_send_pkt(data, 7 + strlen(data+7) + 1); |
664 | break; | 663 | break; |
665 | } | 664 | } |
666 | 665 | ||
@@ -779,7 +778,9 @@ static void iap_handlepkt_mode4(void) | |||
779 | (cur_dbrecord[3] << 8) | | 778 | (cur_dbrecord[3] << 8) | |
780 | cur_dbrecord[4]; | 779 | cur_dbrecord[4]; |
781 | unsigned char selected_playlist | 780 | unsigned char selected_playlist |
782 | [sizeof(global_settings.playlist_catalog_dir) + 1 + MAX_NAME_LENGTH] = {0}; | 781 | [sizeof(global_settings.playlist_catalog_dir) |
782 | + 1 | ||
783 | + MAX_PATH] = {0}; | ||
783 | 784 | ||
784 | strcpy(selected_playlist, | 785 | strcpy(selected_playlist, |
785 | global_settings.playlist_catalog_dir); | 786 | global_settings.playlist_catalog_dir); |
@@ -787,7 +788,7 @@ static void iap_handlepkt_mode4(void) | |||
787 | selected_playlist[len] = '/'; | 788 | selected_playlist[len] = '/'; |
788 | get_playlist_name (selected_playlist + len + 1, | 789 | get_playlist_name (selected_playlist + len + 1, |
789 | item_offset, | 790 | item_offset, |
790 | MAX_NAME_LENGTH); | 791 | MAX_PATH); |
791 | ft_play_playlist(selected_playlist, | 792 | ft_play_playlist(selected_playlist, |
792 | global_settings.playlist_catalog_dir, | 793 | global_settings.playlist_catalog_dir, |
793 | strrchr(selected_playlist, '/') + 1); | 794 | strrchr(selected_playlist, '/') + 1); |