On Thu, 26 Aug 2004 10:56:04 -0500 (EST),
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> You never set pWrd->guess_count to 0, so it could be anything.  If it
> happened to be 1, then this is probably going to coredump when it accesses
> pWrd->guesses[i] because you do not call calloc on that until
> do_wtcorrect().
&
> A lot of people that learned other languages before C (like java) tend to
> forget that C will not initialize data for you.  You need to set every
> variable before you can be sure what it is.  Declaring an int does not
> mean it will equal 0.  It /may/ but it is not guaranteed to be.

With alloc_perm, it uses calloc which 0's everything, no? And free_x
should set it to 0 if its done properly. Orrr, if the new_*  is done
properly you should have a static variable, which is set to zero when
allocated, so it should all be zeroed... of course, if done properly
:P

Davion

Reply via email to