0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-12 00:10:52 +00:00
termux-packages/packages/imlib2/0000-fix-mblen.patch
Kevin Williams 3635ff5eb3 upgpkg(main/imlib2): 1.12.2
Signed-off-by: Kevin Williams <admin@utermux.dev>
2024-02-05 16:41:40 +08:00

25 lines
818 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
@@ -13,6 +13,11 @@
#include "prog_x11.h"
+static int android_mblen(const char *s, size_t n)
+{
+ return mbtowc(0, s, n);
+}
+
static Window win;
void progress(Imlib_Image * im, char percent, int update_x,
@@ -1250,7 +1255,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);