Commit 0adaa53f authored by cmasone's avatar cmasone Committed by Commit bot

Remove trivially-true DEBUG_CHECKs in safe_sprintf.cc

There are some DEBUG_CHECKs here verifying that a size_t is >= 0. Since a size_t is unsigned, these are trivially true and with the default warning settings for CrOS builds, the warning generated here will cause a build failure.

BUG=424334
TEST=ensure existing builds pass

Review URL: https://codereview.chromium.org/642263006

Cr-Commit-Position: refs/heads/master@{#300025}
parent 103ba304
...@@ -176,8 +176,7 @@ class Buffer { ...@@ -176,8 +176,7 @@ class Buffer {
// overflowed |size_|) at any time during padding. // overflowed |size_|) at any time during padding.
inline bool Pad(char pad, size_t padding, size_t len) { inline bool Pad(char pad, size_t padding, size_t len) {
DEBUG_CHECK(pad); DEBUG_CHECK(pad);
DEBUG_CHECK(padding >= 0 && padding <= kSSizeMax); DEBUG_CHECK(padding <= kSSizeMax);
DEBUG_CHECK(len >= 0);
for (; padding > len; --padding) { for (; padding > len; --padding) {
if (!Out(pad)) { if (!Out(pad)) {
if (--padding) { if (--padding) {
...@@ -283,7 +282,6 @@ bool Buffer::IToASCII(bool sign, bool upcase, int64_t i, int base, ...@@ -283,7 +282,6 @@ bool Buffer::IToASCII(bool sign, bool upcase, int64_t i, int base,
DEBUG_CHECK(base <= 16); DEBUG_CHECK(base <= 16);
DEBUG_CHECK(!sign || base == 10); DEBUG_CHECK(!sign || base == 10);
DEBUG_CHECK(pad == '0' || pad == ' '); DEBUG_CHECK(pad == '0' || pad == ' ');
DEBUG_CHECK(padding >= 0);
DEBUG_CHECK(padding <= kSSizeMax); DEBUG_CHECK(padding <= kSSizeMax);
DEBUG_CHECK(!(sign && prefix && *prefix)); DEBUG_CHECK(!(sign && prefix && *prefix));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment