Only test if a char is >= 0x00 when CHAR_MIN is < 0, so gcc doesn't

warn about the comparison always being true.  Fixes build for macppc
target.

Problem noted by me, analysis and fix from Thomas Klausner.

Approved by wiz.
This commit is contained in:
riz 2005-05-01 16:21:07 +00:00
parent e7346e3b2b
commit e09f32d58e
1 changed files with 5 additions and 1 deletions

View File

@ -310,7 +310,11 @@ mb_width (const mbchar_t mbc)
{
if (mbc->bytes == 1)
{
if (mbc->buf[0] >= 0x00 && mbc->buf[0] <= 0x1F)
if (
#if CHAR_MIN < 0x00 /* to avoid gcc warning */
mbc->buf[0] >= 0x00 &&
#endif
mbc->buf[0] <= 0x1F)
{
if (mbc->buf[0] == 0x09)
return 8 - (gram_pos_column & 7);