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/Message/CBodyTable.cp

    r21 r107  
    738738                { 
    739739                        // Copy to global after lock 
    740                         CAttachment** pAddr = reinterpret_cast<CAttachment**>(data); 
    741                         *((CMessage**) pAddr) = (mWindow ? mWindow->GetMessage() : mView->GetMessage()); 
    742                         pAddr += sizeof(CMessage*); 
    743                         *((int*) pAddr) = attchs.size(); 
    744                         pAddr += sizeof(int); 
     740                        unsigned char* ptr = data; 
     741                        *((CMessage**) ptr) = (mWindow ? mWindow->GetMessage() : mView->GetMessage()); 
     742                        ptr += sizeof(CMessage*); 
     743                        *((int*) ptr) = attchs.size(); 
     744                        ptr += sizeof(int); 
    745745                        for(CAttachmentList::iterator iter = attchs.begin(); iter != attchs.end(); iter++) 
    746                                 *pAddr++ = *iter; 
     746                        { 
     747                                *((CAttachment**) ptr) = *iter; 
     748                                ptr += sizeof(CAttachment*); 
     749                        } 
    747750                         
    748751                        seldata->SetData(type, data, dataLength);