diff options
author | Kristian Monsen <kristianm@google.com> | 2011-11-22 13:35:45 +0000 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-11-22 13:35:45 +0000 |
commit | 940e47a8a93a8720ca55c0966689f4cdd4bf5b4e (patch) | |
tree | b40b20185de12cf0f660cd8b37be209e5112f39c | |
parent | 754777ec24185272ad267a324907d384e274b648 (diff) | |
download | external_chromium-940e47a8a93a8720ca55c0966689f4cdd4bf5b4e.zip external_chromium-940e47a8a93a8720ca55c0966689f4cdd4bf5b4e.tar.gz external_chromium-940e47a8a93a8720ca55c0966689f4cdd4bf5b4e.tar.bz2 |
Fix for bug 5152544, remove warning from chromium port
This is a cherry-pick of http://codereview.chromium.org/8354008/
No more warnings after this is merged.
Change-Id: I788d28545e7961d0145a3f1273ce4302f8c432ad
-rw-r--r-- | base/string_split.cc | 10 | ||||
-rw-r--r-- | net/base/dns_util.cc | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/base/string_split.cc b/base/string_split.cc index 44b5d06..9af0bbc 100644 --- a/base/string_split.cc +++ b/base/string_split.cc @@ -53,7 +53,10 @@ void SplitString(const string16& str, void SplitString(const std::string& str, char c, std::vector<std::string>* r) { - DCHECK(c >= 0 && c < 0x7F); +#if CHAR_MIN < 0 + DCHECK(c >= 0); +#endif + DCHECK(c < 0x7F); SplitStringT(str, c, true, r); } @@ -164,7 +167,10 @@ void SplitStringDontTrim(const std::string& str, char c, std::vector<std::string>* r) { DCHECK(IsStringUTF8(str)); - DCHECK(c >= 0 && c < 0x7F); +#if CHAR_MIN < 0 + DCHECK(c >= 0); +#endif + DCHECK(c < 0x7F); SplitStringT(str, c, false, r); } diff --git a/net/base/dns_util.cc b/net/base/dns_util.cc index d97d3d2..ea58e5d 100644 --- a/net/base/dns_util.cc +++ b/net/base/dns_util.cc @@ -60,7 +60,11 @@ std::string DNSDomainToString(const std::string& domain) { std::string ret; for (unsigned i = 0; i < domain.size() && domain[i]; i += domain[i] + 1) { - if (domain[i] < 0 || domain[i] > 63) +#if CHAR_MIN < 0 + if (domain[i] < 0) + return ""; +#endif + if (domain[i] > 63) return ""; if (i) |