This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: Error in io\serial\current\src\common\tty.c
- To: Gary Thomas <gthomas at redhat dot com>
- Subject: Re: [ECOS] Error in io\serial\current\src\common\tty.c
- From: Alexander Hering <Hering at esk dot fhg dot de>
- Date: Fri, 28 Jan 2000 15:34:20 +0100
- CC: eCos Discussion <ecos-discuss at sourceware dot cygnus dot com>
- Organization: FhG - ESK
- References: <XFMail.000128071618.gthomas@redhat.com>
This is a copy of the actual version in CVS:
cyg_uint32 size, clen;
if ((c == '\b') || (c == 0x7F)) {
size -= 2; // erase one character + 'backspace' char
==> if (size < 0) {
size = 0;
} else if (priv->dev_info.tty_in_flags & CYG_TTY_IN_FLAGS_ECHO) {
clen = 3;
cyg_io_write(chan, "\b \b", &clen);
}
There is still the same problem. The variable size cannot be lower
than zero, because it is an unsigned type.
Gary Thomas schrieb:
>
> A fix for this problem has already been installed.
>
> We suggest that you use CVS to keep track of the [very] latest
> eCos sources. See our web page (http://sourceware.cygnus.com/ecos)
> for the details.
>
> On 28-Jan-00 Alexander Hering wrote:
> > Hello,
> >
> > we have found an error in the tty driver.
> > When i press the backspace key, when no more characters are in the
> > buffer, the last input is printed again.
> >
> > In function tty_read size is declared as unsigned int, and must not be
> > tested against a value below zero.
> >
> > ====> cyg_uint32 size, clen;
> >
> > if ((c == '\b') || (c == 0x7F)) {
> > size -= 2; // erase one character + 'backspace' char
> > ====> if (size < 0) size = 0;
> >
> > Greetings
> >
> > Alex
> >
> > --
> > Fraunhofer-Einrichtung
> > Systeme der Kommunikationstechnik
> >
> > Alexander Hering Hansastraße 32
> > Dipl.-Ing. D-80686 München
> > Telefon: +49(0)89/547088-37
> > E-Mail: Hering@esk.fhg.de Telefax: +49(0)89/547088-25
--
Fraunhofer-Einrichtung
Systeme der Kommunikationstechnik
Alexander Hering Hansastraße 32
Dipl.-Ing. D-80686 München
Telefon: +49(0)89/547088-37
E-Mail: Hering@esk.fhg.de Telefax: +49(0)89/547088-25
begin:vcard
n:Hering;Alexander
tel;fax:+49(0)89/547088-20
tel;work:+49(0)89/547088-37
x-mozilla-html:TRUE
org:Fraunhofer-Einrichtung Systeme der Kommunikationstechnik (ESK)
adr:;;Hansastraße 32/IV;München;Bayern;D-80686;Deutschland (Germany)
version:2.1
email;internet:Hering@esk.fhg.de
title:FhG - ESK
x-mozilla-cpt:;-31232
fn:Hering, Alexander
end:vcard