termux-packages/packages/imlib2/0000-fix-mblen.patch
2019-12-16 15:10:09 +02:00

25 lines
803 B
Diff

diff -uNr imlib2-1.6.1/src/bin/imlib2_show.c imlib2-1.6.1.mod/src/bin/imlib2_show.c
--- imlib2-1.6.1/src/bin/imlib2_show.c 2019-12-03 18:26:24.000000000 +0200
+++ imlib2-1.6.1.mod/src/bin/imlib2_show.c 2019-12-16 14:53:36.307439115 +0200
@@ -12,6 +12,11 @@
#include "Imlib2.h"
+static int android_mblen(const char *s, size_t n)
+{
+ return mbtowc(0, s, n);
+}
+
Display *disp;
Window win;
@@ -1262,7 +1267,7 @@
char tmp[16];
int len;
- len = mblen(str + cp, MB_CUR_MAX);
+ len = android_mblen(str + cp, MB_CUR_MAX);
if (len < 0)
len = 1;
strncpy(tmp, str + cp, len);