Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: net/quic/quic_utils.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_utils.cc
diff --git a/net/quic/quic_utils.cc b/net/quic/quic_utils.cc
index f1446512e86e63a06225dc0dd304eac394756535..a0e1de54a5962351bd03f792d157c1d34dc1feac 100644
--- a/net/quic/quic_utils.cc
+++ b/net/quic/quic_utils.cc
@@ -259,13 +259,13 @@ const char* QuicUtils::TransmissionTypeToString(TransmissionType type) {
// static
string QuicUtils::TagToString(QuicTag tag) {
- char chars[4];
+ char chars[sizeof tag];
bool ascii = true;
const QuicTag orig_tag = tag;
- for (size_t i = 0; i < sizeof(chars); i++) {
- chars[i] = tag;
- if ((chars[i] == 0 || chars[i] == '\xff') && i == 3) {
+ for (size_t i = 0; i < arraysize(chars); i++) {
+ chars[i] = static_cast<char>(tag);
+ if ((chars[i] == 0 || chars[i] == '\xff') && i == arraysize(chars) - 1) {
chars[i] = ' ';
}
if (!isprint(static_cast<unsigned char>(chars[i]))) {
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698