termux-packages/packages/imlib2/imlib2-1.5.1_src_bin_imlib2_show.c.patch
2019-11-17 20:12:12 +02:00

25 lines
830 B
Diff

diff -uNr imlib2-1.5.1/src/bin/imlib2_show.c imlib2-1.5.1.mod/src/bin/imlib2_show.c
--- imlib2-1.5.1/src/bin/imlib2_show.c 2018-03-16 17:29:59.000000000 +0200
+++ imlib2-1.5.1.mod/src/bin/imlib2_show.c 2018-11-14 19:08:41.689118629 +0200
@@ -23,6 +23,11 @@
*/
#include "Imlib2.h"
+static int android_mblen(const char *s, size_t n)
+{
+ return mbtowc(0, s, n);
+}
+
Display *disp;
Window win;
Visual *vis;
@@ -1276,7 +1281,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);