Changeset 120 for branches/samba-3.0/source/lib/charcnv.c
- Timestamp:
- Feb 18, 2008, 9:21:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/lib/charcnv.c
r105 r120 1425 1425 uint8_t buf[4]; 1426 1426 smb_iconv_t descriptor; 1427 #ifdef __OS2__ 1428 size_t ilen_max; 1429 #endif 1427 1430 size_t ilen_orig; 1428 1431 size_t ilen; … … 1432 1435 char *outbuf; 1433 1436 1437 #ifdef __OS2__ 1438 *size = 1; 1439 #endif 1440 1434 1441 if ((str[0] & 0x80) == 0) { 1442 #ifndef __OS2__ 1435 1443 *size = 1; 1444 #endif 1436 1445 return (codepoint_t)str[0]; 1437 1446 } … … 1441 1450 descriptor = conv_handles[CH_UNIX][CH_UTF16LE]; 1442 1451 if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) { 1452 #ifndef __OS2__ 1443 1453 *size = 1; 1454 #endif 1444 1455 return INVALID_CODEPOINT; 1445 1456 } 1446 1457 #ifdef __OS2__ 1458 /* We assume that no multi-byte character can take 1459 more than 5 bytes. This is OK as we only 1460 support codepoints up to 1M */ 1461 1462 ilen_max = strnlen( str, 5 ); 1463 #else 1447 1464 *size = 1; 1465 #endif 1448 1466 ilen_orig = 1; 1449 1467 olen_orig = 2; … … 1467 1485 1468 1486 case EINVAL : 1487 #ifndef __OS2__ 1469 1488 /* We assume that no multi-byte character can take 1470 1489 more than 5 bytes. This is OK as we only 1471 1490 support codepoints up to 1M */ 1472 1491 if( ilen_orig < 5 ) 1492 #else 1493 if( ilen_orig < ilen_max ) 1494 #endif 1473 1495 ilen_orig++; 1474 1496 else
Note:
See TracChangeset
for help on using the changeset viewer.