newsboat: use hardcoded length of mbc buffer

Issue https://github.com/termux/termux-packages/issues/7498

Android's MB_LEN_MAX is too small (4). On Linux distributions it is
usually 16, so using this value which resolved the older issue:
https://github.com/termux/termux-packages/issues/4334
This commit is contained in:
Leonid Pliushch 2021-09-08 23:51:54 +03:00
parent cfb2a50bd8
commit 2faeb8dde1
No known key found for this signature in database
GPG Key ID: 45F2964132545795
2 changed files with 22 additions and 0 deletions

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="RSS/Atom feed reader for the text console"
TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.24 TERMUX_PKG_VERSION=2.24
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://newsboat.org/releases/${TERMUX_PKG_VERSION}/newsboat-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=https://newsboat.org/releases/${TERMUX_PKG_VERSION}/newsboat-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=62420688cca25618859548d10ff6df9ac75b9cf766699f37edd3e324d67c6ffb TERMUX_PKG_SHA256=62420688cca25618859548d10ff6df9ac75b9cf766699f37edd3e324d67c6ffb
TERMUX_PKG_DEPENDS="libc++, libiconv, libandroid-support, libandroid-glob, json-c, libsqlite, libcurl, libxml2, stfl, ncurses, openssl" TERMUX_PKG_DEPENDS="libc++, libiconv, libandroid-support, libandroid-glob, json-c, libsqlite, libcurl, libxml2, stfl, ncurses, openssl"

View File

@ -0,0 +1,21 @@
diff -uNr newsboat-2.24/src/tagsouppullparser.cpp newsboat-2.24.mod/src/tagsouppullparser.cpp
--- newsboat-2.24/src/tagsouppullparser.cpp 2021-06-20 20:40:09.000000000 +0300
+++ newsboat-2.24.mod/src/tagsouppullparser.cpp 2021-09-08 23:50:47.207115677 +0300
@@ -445,7 +445,7 @@
if (s.length() > 1 && s[0] == '#') {
std::string result;
unsigned int wc;
- char mbc[MB_LEN_MAX];
+ char mbc[16];
mbc[0] = '\0';
if (s[1] == 'x') {
s.erase(0, 2);
@@ -499,7 +499,7 @@
} else {
for (unsigned int i = 0; entity_table[i].entity; ++i) {
if (s == entity_table[i].entity) {
- char mbc[MB_LEN_MAX];
+ char mbc[16];
const int pos = wcrtomb(mbc, entity_table[i].value, &mb_state);
if (pos == -1) {
return std::string();