[xiph-cvs] cvs commit: vorbis-tools/vorbiscomment vcedit.c
Michael Smith
msmith at xiph.org
Thu Oct 18 03:28:18 PDT 2001
msmith 01/10/18 03:28:17
Modified: vorbiscomment vcedit.c
Log:
Fix same bug as was fixed in libvorbis here.
Revision Changes Path
1.14 +7 -6 vorbis-tools/vorbiscomment/vcedit.c
Index: vcedit.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vorbiscomment/vcedit.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- vcedit.c 2001/08/15 08:33:26 1.13
+++ vcedit.c 2001/10/18 10:28:17 1.14
@@ -6,7 +6,7 @@
*
* Comment editing backend, suitable for use by nice frontend interfaces.
*
- * last modified: $Id: vcedit.c,v 1.13 2001/08/15 08:33:26 msmith Exp $
+ * last modified: $Id: vcedit.c,v 1.14 2001/10/18 10:28:17 msmith Exp $
*/
#include <stdio.h>
@@ -76,9 +76,9 @@
/* Next two functions pulled straight from libvorbis, apart from one change
* - we don't want to overwrite the vendor string.
*/
-static void _v_writestring(oggpack_buffer *o,char *s)
+static void _v_writestring(oggpack_buffer *o,char *s, int len)
{
- while(*s)
+ while(len--)
{
oggpack_write(o,*s++,8);
}
@@ -92,11 +92,11 @@
/* preamble */
oggpack_write(&opb,0x03,8);
- _v_writestring(&opb,"vorbis");
+ _v_writestring(&opb,"vorbis", 6);
/* vendor */
oggpack_write(&opb,strlen(vendor),32);
- _v_writestring(&opb,vendor);
+ _v_writestring(&opb,vendor, strlen(vendor));
/* comments */
oggpack_write(&opb,vc->comments,32);
@@ -105,7 +105,8 @@
for(i=0;i<vc->comments;i++){
if(vc->user_comments[i]){
oggpack_write(&opb,vc->comment_lengths[i],32);
- _v_writestring(&opb,vc->user_comments[i]);
+ _v_writestring(&opb,vc->user_comments[i],
+ vc->comment_lengths[i]);
}else{
oggpack_write(&opb,0,32);
}
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list