Ignore:
Timestamp:
Oct 23, 2000, 9:35:11 PM (25 years ago)
Author:
sandervl
Message:

lstrcpynAtoW/WtoA fixes (Wine depends on 0 terminating of these functions) + console changes for methods that depended on the old behaviour

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/heapstring.cpp

    r4363 r4525  
    1 /* $Id: heapstring.cpp,v 1.33 2000-10-02 13:05:37 phaller Exp $ */
     1/* $Id: heapstring.cpp,v 1.34 2000-10-23 19:35:11 sandervl Exp $ */
    22
    33/*
     
    493493  UniChar* in_buf;
    494494  char*    out_buf;
     495
     496  dprintf2(("KERNEL32: HeapString: lstrcpynWtoA(%08x,%08xh,%d)\n",
     497           astring,
     498           ustring,
     499           unilen));
    495500
    496501  if (ustring == NULL)
     
    552557}
    553558
     559//lstrcpynWtoA and lstrcpynAtoW must zero-terminate the string
     560//because Wine code depends on this behaviour (i.e. comdlg32)
    554561int WIN32API lstrcpynWtoA(LPSTR  astring,
    555562                          LPCWSTR ustring,
    556563                          int    unilen)
    557564{
    558     return lstrcpynCtoA(astring, ustring, unilen, GetWindowsUconvObject());
     565 int ret;
     566
     567    ret = lstrcpynCtoA(astring, ustring, unilen, GetWindowsUconvObject());
     568    astring[unilen-1] = 0;
     569    return ret;
    559570}
    560571
     
    660671}
    661672
     673//lstrcpynWtoA and lstrcpynAtoW must zero-terminate the string
     674//because Wine code depends on this behaviour (i.e. comdlg32)
    662675int WIN32API lstrcpynAtoW(LPWSTR unicode,
    663676                          LPCSTR  ascii,
    664677                          int    asciilen)
    665678{
    666     return lstrcpynAtoC(unicode, ascii, asciilen, GetWindowsUconvObject());
     679 int ret;
     680
     681    ret = lstrcpynAtoC(unicode, ascii, asciilen, GetWindowsUconvObject());
     682    unicode[asciilen-1] = 0;
     683    return ret;
    667684}
    668685
Note: See TracChangeset for help on using the changeset viewer.