Hi guys ,
i got segment fault , and when i trace , found it happens since the value of pointer which is returned by Struct S_client (*ptr) is zero
i know , adding above line of code is not the solution and not correct for the case since above line only check for the pointer to the address of memory which is not expected for me, i would like to check the value of ptr which is returned in struct s_client , not be zero . so anyone know how could i do that , is appreciated?
Here is my code :
Code:
int32_t chk_process (int32_t) {
...
struct s_client *ptr = cur_client();
//FIXME
// how could i check in this line , just when the value of
// ptr is not zero , then it goes to it's next line?`
send_data (ptr, index);
...
...
}
Code:
struct s_client *cur_client(void){
return (struct s_client *) pthread_getspecific(getclient);
}
Best Regards.