]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/audio/libtags/xm.c
cpu: properly handle end of file in readstr()
[plan9front.git] / sys / src / cmd / audio / libtags / xm.c
1 #include "tagspriv.h"
2
3 int
4 tagxm(Tagctx *ctx)
5 {
6         char d[17+20+1], o[20*UTFmax+1], *s;
7
8         if(ctx->read(ctx, d, 17+20) != 17+20 || memcmp(d, "Extended Module: ", 17) != 0)
9                 return -1;
10         d[17+20] = 0;
11         for(s = d+17; *s == ' '; s++);
12         if(cp437toutf8(o, sizeof(o), d+17, 20) > 0)
13                 txtcb(ctx, Ttitle, "", o);
14
15         return 0;
16 }