Skip to content

Commit

Permalink
fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Exle committed Dec 30, 2018
1 parent c65697c commit 07d4dd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions AIMPRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,27 +160,27 @@ BOOL AIMPRemote::InfoUpdateTrackInfo()
memcpy(buffer, offset += AIMPRemote_TrackInfo->AlbumLength, AIMPRemote_TrackInfo->ArtistLength * 2);
buffer[AIMPRemote_TrackInfo->ArtistLength] = 0;
WideCharToMultiByte(CP_UTF8, NULL, buffer, -1, ARTrackInfo.Artist, sizeof(ARTrackInfo.Artist), NULL, NULL);
if(strlen(ARTrackInfo.Album)==1)strcat_s(ARTrackInfo.Artist, sizeof(ARTrackInfo.Artist), " ");
if(strlen(ARTrackInfo.Artist)==1)strcat_s(ARTrackInfo.Artist, sizeof(ARTrackInfo.Artist), " ");

memcpy(buffer, offset += AIMPRemote_TrackInfo->ArtistLength, AIMPRemote_TrackInfo->DateLength * 2);
buffer[AIMPRemote_TrackInfo->DateLength] = 0;
WideCharToMultiByte(CP_UTF8, NULL, buffer, -1, ARTrackInfo.Date, sizeof(ARTrackInfo.Date), NULL, NULL);
if(strlen(ARTrackInfo.Album)==1)strcat_s(ARTrackInfo.Date, sizeof(ARTrackInfo.Date), " ");
if(strlen(ARTrackInfo.Date)==1)strcat_s(ARTrackInfo.Date, sizeof(ARTrackInfo.Date), " ");

memcpy(buffer, offset += AIMPRemote_TrackInfo->DateLength, AIMPRemote_TrackInfo->FileNameLength * 2);
buffer[AIMPRemote_TrackInfo->FileNameLength] = 0;
WideCharToMultiByte(CP_UTF8, NULL, buffer, -1, ARTrackInfo.FileName, sizeof(ARTrackInfo.FileName), NULL, NULL);
if(strlen(ARTrackInfo.Album)==1)strcat_s(ARTrackInfo.FileName, sizeof(ARTrackInfo.FileName), " ");
if(strlen(ARTrackInfo.FileName)==1)strcat_s(ARTrackInfo.FileName, sizeof(ARTrackInfo.FileName), " ");

memcpy(buffer, offset += AIMPRemote_TrackInfo->FileNameLength, AIMPRemote_TrackInfo->GenreLength * 2);
buffer[AIMPRemote_TrackInfo->GenreLength] = 0;
WideCharToMultiByte(CP_UTF8, NULL, buffer, -1, ARTrackInfo.Genre, sizeof(ARTrackInfo.Genre), NULL, NULL);
if(strlen(ARTrackInfo.Album)==1)strcat_s(ARTrackInfo.Genre, sizeof(ARTrackInfo.Genre), " ");
if(strlen(ARTrackInfo.Genre)==1)strcat_s(ARTrackInfo.Genre, sizeof(ARTrackInfo.Genre), " ");

memcpy(buffer, offset += AIMPRemote_TrackInfo->GenreLength, AIMPRemote_TrackInfo->TitleLength * 2);
buffer[AIMPRemote_TrackInfo->TitleLength] = 0;
WideCharToMultiByte(CP_UTF8, NULL, buffer, -1, ARTrackInfo.Title, sizeof(ARTrackInfo.Title), NULL, NULL);
if(strlen(ARTrackInfo.Album)==1)strcat_s(ARTrackInfo.Title, sizeof(ARTrackInfo.Title), " ");
if(strlen(ARTrackInfo.Title)==1)strcat_s(ARTrackInfo.Title, sizeof(ARTrackInfo.Title), " ");

UnmapViewOfFile(AIMPRemote_TrackInfo);
CloseHandle(hFile);
Expand Down
1 change: 0 additions & 1 deletion rapidjson
Submodule rapidjson deleted from 8022a5

0 comments on commit 07d4dd5

Please sign in to comment.