From 32a45d0921f969e8cf91794dbb5af1a5c84f26f4 Mon Sep 17 00:00:00 2001 From: Linus Tufvesson Date: Thu, 28 Aug 2014 16:11:00 +0100 Subject: [PATCH] Fixed octal printing of bytearrays Change-Id: Ia848d7fae9aeab89e65b00f05cee6c1e6d649d94 --- .../main/java/com/google/protobuf/nano/MessageNanoPrinter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java b/java/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java index 572a7075a0..ec12c7da6b 100644 --- a/java/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java +++ b/java/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java @@ -249,7 +249,7 @@ public final class MessageNanoPrinter { } else if (ch >= 32 && ch < 127) { builder.append((char) ch); } else { - builder.append(String.format("\\%03o", ch)); + builder.append(String.format("\\%03o", ch && 0xff)); } } builder.append('"');