| 907 | } |
| 908 | |
| 909 | char* Str::convertAndAddToBuff(std::size_t n, int len, char* buf, const char* bufLim, bool zeroPadded) { |
| 910 | char localBuff[10] = ""; |
| 911 | char* p = localBuff + sizeof(localBuff) - 2; |
| 912 | if (n > 0) { |
| 913 | for (; n > 0 && p > localBuff && len > 0; n /= 10, --len) |
| 914 | *--p = static_cast<char>(n % 10 + '0'); |
| 915 | } else { |
| 916 | *--p = '0'; |
| 917 | --len; |
| 918 | } |
| 919 | if (zeroPadded) |
| 920 | while (p > localBuff && len-- > 0) *--p = static_cast<char>('0'); |
| 921 | return addToBuff(p, buf, bufLim); |
| 922 | } |
| 923 | |
| 924 | char* Str::addToBuff(const char* str, char* buf, const char* bufLim) { |
| 925 | while ((buf < bufLim) && ((*buf = *str++) != '\0')) |
nothing calls this directly
no outgoing calls
no test coverage detected