Re: [gtk-list] Re: still a bug with getpwuid_r [was: Re: 1.1.14



Dave Reed wrote:
> 
> I'm not so certain.  Why does my program crash in gtk_init when the
> line is as below, but is ok when the commented out code is used?
> 
>  guint bufsize = 1; /* sizeof (struct passwd); */

First the sizeof (struct passwd) is wrong here (it was however my fault,
that this came into the source ;-( ). the buffer is used for the strings
that are pointed to by struct passwd, not the struct itself. So, to use 1
is actually very nasty, but nonetheless valid according to the
descripition of the function, but some C-libraries seem to assume a
bufsize of at least 2. Do not ask why, thats the way it is.

Bye, 
Sebastian

-- 
Sebastian Wilhelmi                   |            här ovanför alla molnen
mailto:wilhelmi@ira.uka.de           |      är himmlen så förunerligt blå
http://goethe.ira.uka.de/~wilhelmi   |



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]