Ignore:
Timestamp:
Jun 3, 2006, 9:53:58 AM (15 years ago)
Author:
Eugene Romanenko
Message:

fixed crash on copying large block of text to clipboard

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/clipbrd.cpp

    r35 r37  
    3939#include <string.h>
    4040#include <malloc.h>
     41#include <stdio.h>
    4142#include "cpconv.h"
    4243
     
    7475
    7576        // place to clipboard as unicode
    76         if ( DosAllocSharedMem( &memuni, NULL, olen ,
    77                                 PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE ) == 0 )
     77        if ( DosAllocSharedMem( &memuni, NULL, olen, fALLOCSHR ) == 0 )
    7878        {
    7979            memset( memuni, 0, olen );
    8080            void *tmem = memuni;
    8181
    82             //cpconv c( 1208, 1200 );
    8382            tsav = text;
    84             //c.conv( &text, &len, (char **)&memuni, &olen );
    8583            cnvUTF8ToUni( &text, &len, (char **)&memuni, &olen );
    8684            text = tsav;
     
    9593
    9694        // place to clipboard as current codepage
    97         if ( DosAllocSharedMem( &memcp, NULL, olen ,
    98                                 PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE ) == 0 )
     95        if ( DosAllocSharedMem( &memcp, NULL, olen, fALLOCSHR ) == 0 )
    9996        {
    10097            memset( memcp, 0, olen );
    10198            void *tmem = memcp;
    10299
    103             //cpconv c( 1208 );
    104100            tsav = text;
    105             //c.conv( &text, &len, (char **)&memcp, &olen );
    106101            cnvUTF8ToSys( &text, &len, (char **)&memcp, &olen );
    107102                        text = tsav;
Note: See TracChangeset for help on using the changeset viewer.