]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
mpcinfo: Do not modify string literals
authorIgor <redacted>
Wed, 12 Oct 2016 08:20:30 +0000 (11:20 +0300)
committerTingPing <redacted>
Fri, 14 Oct 2016 17:18:49 +0000 (13:18 -0400)
plugins/mpcinfo/oggInfo.c

index 8ecf0f5b557461233b47d62061c4e2682f3c7861..777d2106b62c05c968a43be1b52ada5cf12f3c6e 100644 (file)
@@ -48,7 +48,7 @@ struct tagInfo getOggHeader(char *file){
        char *sub;
        char *name;
        char *val;
-       char *HEADLOC1, *HEADLOC3, *HEADLOC5;
+       char HEADLOC1[]="_vorbis", HEADLOC3[]="_vorbis", HEADLOC5[]="_vorbis";
        FILE *f;
        struct tagInfo info;
 
@@ -62,11 +62,8 @@ struct tagInfo getOggHeader(char *file){
 
        for (i=0;i<4095;i++) {c=fgetc(f);header[i]=(char)c;}
        fclose(f);
-       HEADLOC1="_vorbis";
        HEADLOC1[0]=1;
-       HEADLOC3="_vorbis";
        HEADLOC3[0]=3;
-       HEADLOC5="_vorbis";
        HEADLOC5[0]=5;
        h1pos=inStr(header,4096,HEADLOC1);
        h3pos=inStr(header,4096,HEADLOC3);