On Fri, Feb 03, 2006 at 10:41:40PM +0100, Jan Niehusmann wrote:
> The reported behaviour is caused by an array not completely initialized
> by realloc_jobs_list. The following patch fixes the bug:
> 
> --- jobs.c.orig       2006-02-03 22:27:07.000000000 +0100
> +++ jobs.c    2006-02-03 22:27:58.000000000 +0100
> @@ -858,6 +858,9 @@
>    for (i = j = 0; i < js.j_jobslots; i++)
>      if (jobs[i])
>        nlist[j++] = jobs[i];
> +  
> +  for (; j<nsize; j++)
> +    nlist[j] = 0;
Why not:
  memset(nlist+j, 0, (nsize-j)*sizeof(*nlist));

which also doesnn't modify j (unless you intended that j=nsize).

Justin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to