Commit e863238b authored by rods%netscape.com's avatar rods%netscape.com
Browse files

Fixed native CF_TEXT copy, to decrement the size by one when it is a null

terminated string. Apps like MS-Word pass back the size including the terminating
zero. This fixes that.
parent 083aeb67
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -371,6 +371,12 @@ nsresult nsClipboard::GetNativeDataOffClipboard(IDataObject * aDataObject, UINT
      switch (stm->tymed) {
        case TYMED_HGLOBAL:
          result = GetGlobalData(stm->hGlobal, aData, aLen);
          if (fe.cfFormat == CF_TEXT) {
            char * str = (char *)*aData;
            if (str[*aLen-1] == 0) {
              (*aLen)--;
            }
          }
          break;
        default:
          break;