shithub: libtags

Download patch

ref: 9d8c78741b182ff6feb2664456d3d53977bd98cf
parent: 3628012134c7b2f9cd310a12e768854ebced67fe
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Mon May 3 13:51:13 EDT 2021

it, mod: use ISO-8859-1 (thanks kemal)

--- a/it.c
+++ b/it.c
@@ -3,12 +3,12 @@
 int
 tagit(Tagctx *ctx)
 {
-	char d[4+26+1], o[26*UTFmax+1];
+	uchar d[4+26+1], o[26*2+1];
 
 	if(ctx->read(ctx, d, 4+26) != 4+26 || memcmp(d, "IMPM", 4) != 0)
 		return -1;
 	d[4+26] = 0;
-	if(cp437toutf8(o, sizeof(o), d+4, 26) > 0)
+	if(iso88591toutf8(o, sizeof(o), d+4, 26) > 0)
 		txtcb(ctx, Ttitle, "", o);
 
 	return 0;
--- a/mod.c
+++ b/mod.c
@@ -25,7 +25,7 @@
 int
 tagmod(Tagctx *ctx)
 {
-	char d[20], o[20*UTFmax+1];
+	uchar d[20], o[20*2+1];
 	int i;
 
 	if(ctx->seek(ctx, 1080, 0) != 1080)
@@ -42,7 +42,7 @@
 		return -1;
 	if(ctx->read(ctx, d, 20) != 20)
 		return -1;
-	if(cp437toutf8(o, sizeof(o), d, 20) > 0)
+	if(iso88591toutf8(o, sizeof(o), d, 20) > 0)
 		txtcb(ctx, Ttitle, "", o);
 
 	return 0;