summaryrefslogtreecommitdiffstats
path: root/source/x/compiz/175.patch
blob: 46eb4533ff8bd6b4a37a6cad146734585ac2bebc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From ea7b3731b1a8a0f2fb7aa765a84374658b67b1b7 Mon Sep 17 00:00:00 2001
From: Sixu Hu <husixu1@hotmail.com>
Date: Wed, 22 Nov 2023 00:54:10 +0800
Subject: [PATCH] Fix compatibility with libxml 2.12

---
 src/main.c     | 6 ++++--
 src/metadata.c | 7 +++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index 26b4c512..7182b75b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -271,8 +271,10 @@ readCoreXmlCallback (void *context,
     i += compReadXmlChunk ("</screen></core></compiz>", &offset, buffer + i,
 			   length - i);
 
-    if (!offset && length > i)
-	buffer[i++] = '\0';
+    if (!offset && length > i) {
+	    // buffer[i] = '\0';
+        ctx->offset += 1;
+    }
 
     ctx->offset += i;
 
diff --git a/src/metadata.c b/src/metadata.c
index 3c1fa9ff..559734aa 100644
--- a/src/metadata.c
+++ b/src/metadata.c
@@ -30,6 +30,7 @@
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 #include <locale.h>
+#include <stdlib.h>
 
 #include <compiz-core.h>
 
@@ -285,8 +286,10 @@ readPluginXmlCallback (void *context,
     i += compReadXmlChunk ("</plugin></compiz>", &offset, buffer + i,
 			   length - i);
 
-    if (!offset && length > i)
-	buffer[i++] = '\0';
+    if (!offset && length > i) {
+	    // buffer[i] = '\0';
+        ctx->offset += 1;
+    }
 
     ctx->offset += i;
 
-- 
GitLab