Help please

Schaefer sf at bonn.iz-soz.de
Mon Dec 18 08:05:06 GMT 2000


> On 15 Dec 00, Schaefer wrote,
> 
>  | Simon (and others?), you can access some examples I put 
> together for the
>  | same reason. They are rather rough translations from the 
> examples in 'Wimp
>  | programming for all' - so if you need more background look 
> it up in that
>  | book, if you can get hold of it.
> 
>    Nice job. Just spotted a bug though ... the function
> 
> void poll()
> {
>   os_error *err;
>   wimp_event_no *reason;
>   err = xwimp_poll(0, block, NULL, reason);
>   switch(*reason)
>   {
>     case wimp_NULL_REASON_CODE:{
>     	error("Dieses Programm tut noch nichts!");
>     	quit=TRUE;
>     }
>     break;
>   }
>   
> }
> 
> writes through an uninitialised pointer (|reason|), which can 
> corrupt any 
> memory location in the system. It should read
> 
> void poll()
> {
>   os_error *err;
>   wimp_event_no reason;
>   err = xwimp_poll(0, block, NULL, &reason);
>   switch(reason)
>   {
>     case wimp_NULL_REASON_CODE:{
>     	error("Dieses Programm tut noch nichts!");
>     	quit=TRUE;
>     }
>     break;
>   }
> }

You're right, of course. Thank you for spotting it!

I'll correct it right now.

Have fun,
André



More information about the oslib-user mailing list