Ignore:
Timestamp:
Jul 1, 2011, 4:02:23 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/util_str.c

    r414 r594  
    14551455
    14561456/**
     1457
     1458
     1459
     1460
     1461
     1462
     1463
     1464
     1465
     1466
     1467
     1468
     1469
     1470
     1471
     1472
     1473
     1474
     1475
     1476
     1477
     1478
     1479
     1480
     1481
     1482
     1483
     1484
     1485
     1486
     1487
     1488
     1489
     1490
     1491
     1492
     1493
     1494
     1495
     1496
     1497
     1498
     1499
     1500
     1501
     1502
     1503
     1504
     1505
     1506
     1507
     1508
     1509
     1510
     1511
     1512
     1513
     1514
     1515
     1516
     1517
     1518
     1519
     1520
     1521
     1522
     1523
     1524
     1525
     1526
     1527
     1528
     1529
     1530
     1531
     1532
    14571533 Count the number of UCS2 characters in a string. Normally this will
    14581534 be the same as the number of bytes in a string for single byte strings,
     
    14621538size_t strlen_m(const char *s)
    14631539{
    1464         size_t count = 0;
    1465 
    1466         if (!s) {
    1467                 return 0;
    1468         }
    1469 
    1470         while (*s && !(((uint8_t)*s) & 0x80)) {
    1471                 s++;
    1472                 count++;
    1473         }
    1474 
    1475         if (!*s) {
    1476                 return count;
    1477         }
    1478 
    1479         while (*s) {
    1480                 size_t c_size;
    1481                 codepoint_t c = next_codepoint(s, &c_size);
    1482                 if (c < 0x10000) {
    1483                         /* Unicode char fits into 16 bits. */
    1484                         count += 1;
    1485                 } else {
    1486                         /* Double-width unicode char - 32 bits. */
    1487                         count += 2;
    1488                 }
    1489                 s += c_size;
    1490         }
    1491 
    1492         return count;
     1540        return strlen_m_ext(s, CH_UTF16LE);
    14931541}
    14941542
Note: See TracChangeset for help on using the changeset viewer.