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

List:       kde-devel
Subject:    Re: Fixed: KFM and KPANEL not working in latest Digital Unix port.
From:       Thomas Leitner <tom () radar ! tu-graz ! ac ! at>
Date:       1999-09-24 14:55:51
[Download RAW message or body]


On Fri, 24 Sep 1999, Uwe Thiem wrote:

> > >       // we are running local, so add the hostname
> > >       char name[256];
>                     ^^^
> Shouldn't this be MAXHOSTNAMELENGTH+1 (as provided in sys/param.h)?

Yes. In a perfect world. However, MAXHOSTNAMELENGTH might not be defined
on all systems, so taking 256 should be enough for all cases.

> In the current implementation the last character might be overwritten!

What do you mean by "current implementation"? My fix or the implementation
before that? In my fix, an overwrite only occurs, when the hostname is
exactly 255 bytes long. It is stripped off when its longer than that
anyway by gethostbyname(xx,256). So if the limit is 255 or 256 really
makes not difference. These are subtle academic differences here which
don't matter in the real world.

Tom
-- 
--------------------------------------------------------------------------
T o m   L e i t n e r                       Dept. of Communications
                                            Graz University of Technology, 
e-mail    : tom@radar.tu-graz.ac.at         Inffeldgasse 12
Phone     : +43-316-873-7455                A-8010 Graz / Austria / Europe
Fax       : +43-316-463-697
Home page : http://wiis.tu-graz.ac.at/people/tom.html
PGP public key on : ftp://wiis.tu-graz.ac.at/pgp-keys/tom.asc or send 
mail with subject "get Thomas Leitner" to pgp-public-keys@keys.pgp.net
--------------------------------------------------------------------------
    Before we have the paperless office, we have the paperless toilet!

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

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