This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Error in io\serial\current\src\common\tty.c



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]