>  func = dlsym(dlhandle,"ladspa_descriptor");
>  if (func == NULL) {
>    /* check if we really got an error */
>    error = dlerror(); /* save because next call to dlerror() returns NULL */
>    if (error != NULL) {
>      /*   my error code deleted   */
>    }
>    /* else the NULL is a valid function address */
>  }

this code is wrong. it should be:

  func = dlsym(dlhandle,"ladspa_descriptor");
  if ((error = dlerror()) == NULL) {
             ... handle error ... 
  } 

  ... func points to a valid symbol ...

func is allowed to be zero. its a pointer to a symbol, not necessarily
a function.

--p

Reply via email to