Re: How to initialise a C-struct safely?

2004-01-05 Thread Angus Leeming
On Monday 05 January 2004 2:20 pm, Andre Poenitz wrote: > On Mon, Jan 05, 2004 at 02:01:03PM +, Angus Leeming wrote: > > Is there a safe way of initialising a c-struct? I have this: > > > > vector const glob(string const & pattern, int flags) > > { > > glob_t glob_buffer = {0, 0, 0, 0,

Re: How to initialise a C-struct safely?

2004-01-05 Thread Andre Poenitz
On Mon, Jan 05, 2004 at 02:01:03PM +, Angus Leeming wrote: > Is there a safe way of initialising a c-struct? I have this: > > vector const glob(string const & pattern, int flags) > { > glob_t glob_buffer = {0, 0, 0, 0, 0, 0, 0, 0, 0}; This is safe. Andre'

How to initialise a C-struct safely?

2004-01-05 Thread Angus Leeming
Is there a safe way of initialising a c-struct? I have this: vector const glob(string const & pattern, int flags) { glob_t glob_buffer = {0, 0, 0, 0, 0, 0, 0, 0, 0}; glob(pattern.c_str(), flags, 0, &glob_buffer); vector const matches(glob_buffer.gl_pathv,