Petr Novotny wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 2 May 00, at 15:21, Federico Barbazza wrote:
> 
> > Hi all,
> > if in qmail-pop3d i declared a variable:
> >
> > stralloc *arrayname;
> > int numm = 30;
> > arrayname = (stralloc *) alloc(numm * sizeof(stralloc))
> 
> Does alloc() initialize the memory it allocates? To which value?
how can i see??
> 
> > for (i=0; i<numm; i++)
> >     stralloc_copys(&arrayname[i], "hello");
> >
> > This code exit with a "segmentation fault" sometimes immediatly
> > sometimes when i = 2.
> > Is it a memory problem??
> 
> Whose memory? :-)
> 
> Looks like the memory is initialized to arbitrary values, sometimes -
> - - by chance - to NULL or something, and therefore not crashing.
I saw stralloc are initializate as:
stralloc variable = {0}.
How can i initialize my stralloc array??


> 
> -----BEGIN PGP SIGNATURE-----
> Version: PGP 6.0.2 -- QDPGP 2.60
> Comment: http://community.wow.net/grt/qdpgp.html
> 
> iQA/AwUBOQ7JVlMwP8g7qbw/EQJ1GQCg36xGK+18R+uY62Eo+rxc6eswuQwAoNh2
> WbTpXM7VVTQtI0rPGCE6QMXj
> =O9kb
> -----END PGP SIGNATURE-----
> --
> Petr Novotny, ANTEK CS
> [EMAIL PROTECTED]
> http://www.antek.cz
> PGP key ID: 0x3BA9BC3F
> -- Don't you know there ain't no devil there's just God when he's drunk.
>                                                              [Tom Waits]

Reply via email to