Changeset 59703 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- Feb 16, 2016 1:50:10 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strformat.cpp
r57944 r59703 364 364 const char *pszFormat, va_list InArgs) 365 365 { 366 char szTmp[64]; /* Worker functions assumes 64 byte buffer! Ugly but faster. */ 366 367 va_list args; 367 368 KSIZE cch = 0; … … 520 521 case 'c': 521 522 { 522 char ch;523 524 523 if (!(fFlags & RTSTR_F_LEFT)) 525 524 while (--cchWidth > 0) 526 525 cch += pfnOutput(pvArgOutput, " ", 1); 527 526 528 ch = (char)va_arg(args, int); 529 cch += pfnOutput(pvArgOutput, SSToDS(&ch), 1); 527 szTmp[0] = (char)va_arg(args, int); 528 szTmp[1] = '\0'; /* Some output functions wants terminated strings. */ 529 cch += pfnOutput(pvArgOutput, SSToDS(&szTmp[0]), 1); 530 530 531 531 while (--cchWidth > 0) … … 559 559 RTUNICP Cp; 560 560 RTUtf16GetCpEx(&pwszStr, &Cp); 561 char szUtf8[8]; /* Cp=0x7fffffff -> 6 bytes. */ 562 char *pszEnd = RTStrPutCp(szUtf8, Cp); 563 cch += pfnOutput(pvArgOutput, szUtf8, pszEnd - szUtf8); 561 char *pszEnd = RTStrPutCp(szTmp, Cp); 562 cch += pfnOutput(pvArgOutput, szTmp, pszEnd - szTmp); 564 563 #else 565 564 char ch = (char)*pwszStr++; … … 591 590 /**@todo \#ifndef IN_RC*/ 592 591 #ifdef IN_RING3 593 char szUtf8[8]; /* Cp=0x7fffffff -> 6 bytes. */ 594 char *pszEnd = RTStrPutCp(szUtf8, *puszStr++); 595 cch += pfnOutput(pvArgOutput, szUtf8, pszEnd - szUtf8); 592 char *pszEnd = RTStrPutCp(szTmp, *puszStr++); 593 cch += pfnOutput(pvArgOutput, szTmp, pszEnd - szTmp); 596 594 #else 597 595 char ch = (char)*puszStr++; … … 633 631 case 'X': 634 632 { 635 char achNum[64]; /* FIXME */636 633 int cchNum; 637 634 uint64_t u64Value; … … 754 751 } 755 752 } 756 cchNum = RTStrFormatNumber((char *)SSToDS(& achNum), u64Value, uBase, cchWidth, cchPrecision, fFlags);757 cch += pfnOutput(pvArgOutput, (char *)SSToDS(& achNum), cchNum);753 cchNum = RTStrFormatNumber((char *)SSToDS(&szTmp), u64Value, uBase, cchWidth, cchPrecision, fFlags); 754 cch += pfnOutput(pvArgOutput, (char *)SSToDS(&szTmp), cchNum); 758 755 break; 759 756 }
Note:
See TracChangeset
for help on using the changeset viewer.