~ft/public-inbox

libtags: Don't null-terminate already null-terminated strings v1 PROPOSED

jacqueline: 1
 Don't null-terminate already null-terminated strings

 1 files changed, 2 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~ft/public-inbox/patches/43125/mbox | git am -3
Learn more about email & git

[PATCH libtags] Don't null-terminate already null-terminated strings Export this patch

This was causing issues with genre tags sourced from id3genres (I think
all m4a files with genres might be affected?). id3genres is const, so
even when the write is a no-op, attempting it caused a segfault
---
 tags.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tags.c b/tags.c
index 6c6b2b5..815a3e4 100644
--- a/tags.c
+++ b/tags.c
@@ -46,7 +46,8 @@ tagscallcb(Tagctx *ctx, int type, const char *k, char *s, int offset, int size,
		e = s + strlen(s);
		while(e != s && (uchar)e[-1] <= ' ')
			e--;
		*e = 0;
		if (*e != 0)
		  *e = 0;
	}
	if(*s){
		ctx->tag(ctx, type, k, s, offset, size, f);
-- 
2.40.1