pgRouting

Changeset 113

Show
Ignore:
Timestamp:
03/03/08 16:17:17 (9 months ago)
Author:
anton
Message:

Segfault fixed. See Forum #21 - Topic #118

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/extra/driving_distance/src/alpha.c

    r93 r113  
    333333      DBG("Before allocation\n"); 
    334334 
    335       values = palloc(2 * sizeof(Datum)); 
    336       nulls = palloc(2 * sizeof(char)); 
     335      values = palloc(3 * sizeof(Datum)); 
     336      nulls = palloc(3 * sizeof(char)); 
    337337 
    338338      DBG("After allocation\n"); 
    339339 
    340       values[0] = Float8GetDatum(res[call_cntr].x)
     340      values[0] = call_cntr
    341341      nulls[0] = ' '; 
    342342 
    343       values[1] = Float8GetDatum(res[call_cntr].y); 
     343      values[1] = Float8GetDatum(res[call_cntr].x); 
    344344      nulls[1] = ' '; 
     345 
     346      values[2] = Float8GetDatum(res[call_cntr].y); 
     347      nulls[2] = ' '; 
    345348 
    346349      DBG("Heap making\n"); 
  • trunk/extra/driving_distance/src/drivedist.c

    r43 r113  
    436436     
    437437 
    438     values = palloc(3 * sizeof(Datum)); 
    439     nulls = palloc(3 * sizeof(char)); 
    440      
    441 //  values[0] = Int32GetDatum(call_cntr)
    442 //  nulls[0] = ' '; 
    443     values[0] = Int32GetDatum(path[call_cntr].vertex_id); 
    444     nulls[0] = ' '; 
    445     values[1] = Int32GetDatum(path[call_cntr].edge_id); 
    446     nulls[1] = ' '; 
    447     values[2] = Float8GetDatum(path[call_cntr].cost); 
    448     nulls[2] = ' '; 
    449  
     438    values = palloc(4 * sizeof(Datum)); 
     439    nulls = palloc(4 * sizeof(char)); 
     440     
     441    values[0] = call_cntr
     442    nulls[0] = ' '; 
     443    values[1] = Int32GetDatum(path[call_cntr].vertex_id); 
     444    nulls[1] = ' '; 
     445    values[2] = Int32GetDatum(path[call_cntr].edge_id); 
     446    nulls[2] = ' '; 
     447    values[3] = Float8GetDatum(path[call_cntr].cost); 
     448    nulls[3] = ' '; 
     449       
    450450    tuple = heap_formtuple(tuple_desc, values, nulls); 
    451451