Ticket #331: destination.c.diff

File destination.c.diff, 921 bytes (added by Stressedpiper, 12 years ago)
  • destination.c

     
    7070static char *description(struct search_param *search, GtkTreeIter *iter)
    7171{
    7272        char *desc,*car,*postal,*town,*street;
     73        char empty='\0';
     74               
    7375        gtk_tree_model_get (GTK_TREE_MODEL (search->liststore2), iter, 0, &car, -1);
    7476        gtk_tree_model_get (GTK_TREE_MODEL (search->liststore2), iter, 1, &postal, -1);
    7577        gtk_tree_model_get (GTK_TREE_MODEL (search->liststore2), iter, 2, &town, -1);
    7678        gtk_tree_model_get (GTK_TREE_MODEL (search->liststore2), iter, 4, &street, -1);
     79       
     80        /* protect against nulls */
     81    if (car==0) car=∅
     82    if (postal==0) postal=∅   
     83    if (town==0) town=∅
     84    if (street==0) street=∅
     85       
    7786        if (search->attr.type == attr_town_name)
    7887                desc=g_strdup_printf("%s-%s %s", car, postal, town);
    7988        else