Changeset 90847 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Aug 24, 2021 1:16:58 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/log/log.cpp
r90829 r90847 4587 4587 cb = cbBuf - offBuf - 1; 4588 4588 } 4589 else if (cb <= 0)4589 else if (cb <= 2) /* 2 - Make sure we can write a \r\n and not loop forever. */ 4590 4590 { 4591 4591 rtlogFlush(pLoggerInt, true /*fNeedSpace*/); … … 4607 4607 pLoggerInt->fPendingPrefix = true; 4608 4608 } 4609 else if ( cbBuf - offBuf < (uintptr_t)(pszNewLine - pachChars + 2))4609 else if ((uintptr_t)(pszNewLine - pachChars) + 2U < cbBuf - offBuf) 4610 4610 { 4611 4611 cb = pszNewLine - pachChars; … … 4613 4613 pchBuf[offBuf + cb++] = '\r'; 4614 4614 pchBuf[offBuf + cb++] = '\n'; 4615 pachChars--; /* Discount the extra '\r'. */4616 4615 cbChars++; /* Discount the extra '\r'. */ 4616 pachChars--; /* Ditto. */ 4617 4617 cbRet--; /* Ditto. */ 4618 4618 pLoggerInt->fPendingPrefix = true;
Note:
See TracChangeset
for help on using the changeset viewer.