Changeset 3047 for pjproject/trunk/pjlib/src/pj/unicode_win32.c
- Timestamp:
- Jan 6, 2010 2:35:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/unicode_win32.c
r2394 r3047 31 31 len = MultiByteToWideChar(CP_ACP, 0, s, len, 32 32 buf, buf_count); 33 buf[len] = 0; 33 if (buf_count) { 34 if (len < buf_count) 35 buf[len] = 0; 36 else 37 buf[len-1] = 0; 38 } 39 34 40 return buf; 35 41 } … … 42 48 43 49 len = WideCharToMultiByte(CP_ACP, 0, wstr, len, buf, buf_size, NULL, NULL); 44 buf[len] = '\0'; 50 if (buf_size) { 51 if (len < buf_size) 52 buf[len] = '\0'; 53 else 54 buf[len-1] = '\0'; 55 } 56 45 57 return buf; 46 58 }
Note: See TracChangeset
for help on using the changeset viewer.