********************************************************************
function: maintain the info structure, info <-> header packets
- last mod: $Id: info.c,v 1.26 2000/07/29 08:45:33 msmith Exp $
+ last mod: $Id: info.c,v 1.27 2000/07/30 13:10:10 msmith Exp $
********************************************************************/
void vorbis_comment_add_tag(vorbis_comment *vc, char *tag, char *contents){
char *comment=alloca(strlen(tag)+strlen(contents)+2); /* +2 for = and \0 */
strcpy(comment, tag);
- comment[strlen(tag)] = '=';
+ strcat(comment, "=");
strcat(comment, contents);
vorbis_comment_add(vc, comment);
}
long i;
int found = 0;
int taglen = strlen(tag);
+ char *fulltag = alloca(taglen+ 2);
+
+ strcpy(fulltag, tag);
+ strcat(fulltag, "=");
for(i=0;i<vc->comments;i++){
- if(!tagcompare(vc->user_comments[i], tag, taglen)){
+ if(!tagcompare(vc->user_comments[i], fulltag, taglen)){
if(count == found)
/* We return a pointer to the data, not a copy */
return vc->user_comments[i] + taglen + 1;