From: Aaron Dierking Date: Thu, 14 Jun 2018 18:38:31 +0000 (-0700) Subject: Use CHAR_BIT instead of NBBY in strnvis() X-Git-Tag: 0.10.0~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b9dee9f69a6e9f03418bde5638642ddc8df18f74;p=thirdparty%2Flibbsd.git Use CHAR_BIT instead of NBBY in strnvis() is not available on Windows. Signed-off-by: Guillem Jover --- diff --git a/src/vis.c b/src/vis.c index 3e6ade8..260d3c1 100644 --- a/src/vis.c +++ b/src/vis.c @@ -57,7 +57,6 @@ #include #include -#include #include #pragma GCC diagnostic push @@ -308,7 +307,7 @@ do_svis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) /* See comment in istrsenvisx() output loop, below. */ wmsk = 0; for (i = sizeof(wmsk) - 1; i >= 0; i--) { - shft = i * NBBY; + shft = i * CHAR_BIT; bmsk = (uint64_t)0xffLL << shft; wmsk |= bmsk; if ((c & wmsk) || i == 0) @@ -539,7 +538,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength, clen = 0; wmsk = 0; for (i = sizeof(wmsk) - 1; i >= 0; i--) { - shft = i * NBBY; + shft = i * CHAR_BIT; bmsk = (uint64_t)0xffLL << shft; wmsk |= bmsk; if ((*dst & wmsk) || i == 0)