pgRouting

Changeset 114

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

Segfault fixed. See Forum #21 - Topic #118

Files:

Legend:

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

    r59 r114  
    436436      DBG("Before allocation\n"); 
    437437 
    438       values = (Datum*)palloc(3*sizeof(Datum)); 
    439       nulls = (char*)palloc(3*sizeof(char)); 
     438      values = (Datum*)palloc(4*sizeof(Datum)); 
     439      nulls = (char*)palloc(4*sizeof(char)); 
    440440 
    441441      DBG("After allocation\n"); 
    442442 
    443       values[0] = Int32GetDatum(path[call_cntr].vertex_id); 
     443 
     444      values[0] = call_cntr; 
    444445      nulls[0] = ' '; 
    445       values[1] = Int32GetDatum(path[call_cntr].edge_id); 
     446      values[1] = Int32GetDatum(path[call_cntr].vertex_id); 
    446447      nulls[1] = ' '; 
    447       values[2] = Float8GetDatum(path[call_cntr].cost); 
     448      values[2] = Int32GetDatum(path[call_cntr].edge_id); 
    448449      nulls[2] = ' '; 
    449  
     450      values[3] = Float8GetDatum(path[call_cntr].cost); 
     451      nulls[3] = ' '; 
     452       
    450453      DBG("Heap making\n"); 
    451454