[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KExtendedSocket: putch sends int instead of char
From:       Thiago Macieira <thiagom () wanadoo ! fr>
Date:       2002-01-30 18:58:52
[Download RAW message or body]

Erik Sigra wrote
>It seems like "int getch ()" really only removes a character from the
> stream, as it should. Is this correct?

Correct.

>But "int putch (int ch)" sends an integer. The first byte will contain the
>intended character and the other 3 bytes will contain garbage, in this case
>"Ìëÿ" (204, 235, 255). This causes problems at the other end of the
>connection. My test program had to skip 3 characters after each read. This
>seems like an annoying bug.

Huh... sorry. My bad. A simple typo caused all that hassle. I've fixed it, but 
I'll have to wait to commit to CVS (we're right now frozen for the release of 
beta2).

And, yes, it's supposed to send one character (one byte) only.

-- 
  Thiago Macieira - UFOT Registry number: 1001
 thiagom@mail.com
   ICQ UIN: 1967141  PGP: 0x8F2978D5 and 0xEA9037A5 (PGP 2.x)
     Registered Linux user #65028


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic