From: <sag...@us...> - 2010-09-12 19:55:20
|
Revision: 708 http://modplug.svn.sourceforge.net/modplug/?rev=708&view=rev Author: saga-games Date: 2010-09-12 19:55:14 +0000 (Sun, 12 Sep 2010) Log Message: ----------- [Imp] Made tagging functions a bit more stable (apparently nothing was broken, but let's better be safe than sorry) Modified Paths: -------------- trunk/OpenMPT/mptrack/tagging.cpp trunk/OpenMPT/mptrack/tagging.h Modified: trunk/OpenMPT/mptrack/tagging.cpp =================================================================== --- trunk/OpenMPT/mptrack/tagging.cpp 2010-09-11 15:42:24 UTC (rev 707) +++ trunk/OpenMPT/mptrack/tagging.cpp 2010-09-12 19:55:14 UTC (rev 708) @@ -86,15 +86,15 @@ void CFileTagging::WriteID3v2Frame(char cFrameID[4], string sFramecontent, FILE *f) //--------------------------------------------------------------------------------- { - if(!strcmp(cFrameID, "") || sFramecontent.empty() || !f) return; + if(!cFrameID[0] || sFramecontent.empty() || !f) return; - if(!strcmp(cFrameID, "COMM")) + if(!memcmp(cFrameID, "COMM", 4)) { // English language for comments - no description following (hence the text ending nullchar(s)) // For language IDs, see http://en.wikipedia.org/wiki/ISO-639-2 sFramecontent = "eng" + (ID3v2_TEXTENDING + sFramecontent); } - if(!strcmp(cFrameID, "WXXX")) + if(!memcmp(cFrameID, "WXXX", 4)) { // User-defined URL field (we have no description for the URL, so we leave it out) sFramecontent = ID3v2_TEXTENDING + sFramecontent; Modified: trunk/OpenMPT/mptrack/tagging.h =================================================================== --- trunk/OpenMPT/mptrack/tagging.h 2010-09-11 15:42:24 UTC (rev 707) +++ trunk/OpenMPT/mptrack/tagging.h 2010-09-12 19:55:14 UTC (rev 708) @@ -78,8 +78,8 @@ // charset... choose text ending accordingly. // $00 = ISO-8859-1. Terminated with $00. -// $01 = UTF-16. Terminated with $00 00. -// $02 = UTF-16BE. Terminated with $00 00. +// $01 = UTF-16 with BOM. Terminated with $00 00. +// $02 = UTF-16BE without BOM. Terminated with $00 00. // $03 = UTF-8. Terminated with $00. #ifdef UNICODE #define ID3v2_CHARSET '\3' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |