It only prints the description when I print b again after the if statement, really weird behavior, when I remove the last line it doesn't print description is ...
dos anyone know why this happens and how I can fix this? Thanks
char * b;
if (list!= NULL){
b = strdup ( (char *)g_object_get_data(G_OBJECT(list->data), "description") );
printf(" description is %s ", b);
}
printf("\nprinting b: %s\n", b);