Skip to contentSkip to conversation

lcd_putc bug?

U-Boot Derek Ou 2 participants 2 messages Feb 3, 2009

lore
Share & tools
lore

Derek Ou

author
#0 lore raw

In the lcd_putc() of common/lcd.c, line 189 handles tab '\t'. And the following lines:

            console_col |=  8;
            console_col &= ~7;

seems to have problems. If console_col is 9, it will become 8 after the above two lines, which means instead of tab of 8 spaces, it goes back
1. Is this intentional or a bug?

I think it should be console_col += 8; instead of console_col |= 8;

Derek

#1 lore raw

Dear Derek Ou,

Quoted 9 lines · In message <[email protected]> you wrote:

In the lcd_putc() of common/lcd.c, line 189 handles tab '\t'. And the following lines:

            console_col |=  8;
            console_col &= ~7;

seems to have problems. If console_col is 9, it will become 8 after the above two lines, which means instead of tab of 8 spaces, it goes back
1. Is this intentional or a bug?

I think it should be console_col += 8; instead of console_col |= 8;

I think you are right - can you please submit a patch?

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A student of  probability  soon  realizes  that  by  its  nature  the
billion-to-one  chance  crops  up nine times out of ten, and that the
greatest odds boil down to a double-sided statement: it will  happen,
or it will not.         - Terry Pratchett, _The Dark Side of the Sun_