Show
Ignore:
Timestamp:
09/15/07 20:20:13 (1 year ago)
Author:
daboo
Message:

Fix some bad pointer arithmetic errors. This fixes crashes during drag and drop.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/trunk/Linux/Sources/Application/Server/CServerTable.cp

    r21 r107  
    740740                if (data) 
    741741                { 
    742                         int* i = reinterpret_cast<int*>(data); 
    743                         *i = count; 
    744                         i++; 
    745                         void** vdata = reinterpret_cast<void**>(i); 
     742                        unsigned char* ptr = data; 
     743                        *((int*) ptr) = count; 
     744                        ptr += sizeof(int); 
     745                        void** vdata = reinterpret_cast<void**>(ptr); 
    746746                        for(ulvector::const_iterator iter = rows.begin(); iter != rows.end(); iter++) 
    747747                        { 
     
    13251325                } 
    13261326 
    1327                 //int count = *((int*) drag_data)++; 
    13281327                int count = *((int*)drag_data); 
    13291328                drag_data += sizeof(int); 
     
    13571356        else if (theFlavor == CMulberryApp::sFlavorWDList) 
    13581357        { 
    1359                 //int count = *((int*) drag_data)++; 
    13601358                int count = *(int*)(drag_data); 
    13611359                drag_data += sizeof(int); 
     
    14011399        else if (theFlavor == CMulberryApp::sFlavorMboxList) 
    14021400        { 
    1403                 //int count = *((int*) drag_data)++; 
    14041401                int count = *(int*)drag_data; 
    14051402                drag_data += sizeof(int);