mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-11 20:50:42 +02:00
size_t changes for multibyte characters; fix for running debug trap in asynchronous pipeline; remove support for precomputed cache files for cross-compiling; more size_t and ssize_t changes to avoid overflow
This commit is contained in:
+4
-4
@@ -106,8 +106,7 @@ sh_modcase (const char *string, char *pat, int flags)
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
wchar_t nwc;
|
||||
char mb[MB_LEN_MAX+1];
|
||||
int mlen;
|
||||
size_t m;
|
||||
size_t m, mlen;
|
||||
mbstate_t state;
|
||||
#endif
|
||||
|
||||
@@ -249,8 +248,9 @@ singlebyte:
|
||||
else
|
||||
{
|
||||
mlen = wcrtomb (mb, nwc, &state);
|
||||
if (mlen > 0)
|
||||
mb[mlen] = '\0';
|
||||
if (MB_INVALIDCH (mlen))
|
||||
strncpy (mb, string + start, mlen = m);
|
||||
mb[mlen] = '\0';
|
||||
/* Don't assume the same width */
|
||||
strncpy (ret + retind, mb, mlen);
|
||||
retind += mlen;
|
||||
|
||||
+3
-1
@@ -38,7 +38,9 @@ extern int errno;
|
||||
int
|
||||
zwrite (int fd, char *buf, size_t nb)
|
||||
{
|
||||
int n, i, nt;
|
||||
int nt;
|
||||
size_t n;
|
||||
ssize_t i;
|
||||
|
||||
for (n = nb, nt = 0;;)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user