aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/FieldCodec.cs
diff options
context:
space:
mode:
authorJan Tattermusch <jtattermusch@users.noreply.github.com>2015-08-05 17:16:13 -0700
committerJan Tattermusch <jtattermusch@users.noreply.github.com>2015-08-05 17:16:13 -0700
commitad8a889d1e1e2b0efd5b7579aa57ea5326cda6da (patch)
tree48e9e14f18ee1ff081df8d26a361665b9d458f74 /csharp/src/Google.Protobuf/FieldCodec.cs
parent607940321c8ceeb80ec1099d94add8eef86825e5 (diff)
parent38032688a7faf4eef2cac392b9e69697a202fe62 (diff)
downloadprotobuf-ad8a889d1e1e2b0efd5b7579aa57ea5326cda6da.tar.gz
protobuf-ad8a889d1e1e2b0efd5b7579aa57ea5326cda6da.tar.bz2
protobuf-ad8a889d1e1e2b0efd5b7579aa57ea5326cda6da.zip
Merge pull request #692 from jskeet/tag-0
Change ReadTag/PeekTag behaviour to return 0 at EOF
Diffstat (limited to 'csharp/src/Google.Protobuf/FieldCodec.cs')
-rw-r--r--csharp/src/Google.Protobuf/FieldCodec.cs6
1 files changed, 1 insertions, 5 deletions
diff --git a/csharp/src/Google.Protobuf/FieldCodec.cs b/csharp/src/Google.Protobuf/FieldCodec.cs
index 1076c2a9..15d52c7d 100644
--- a/csharp/src/Google.Protobuf/FieldCodec.cs
+++ b/csharp/src/Google.Protobuf/FieldCodec.cs
@@ -298,12 +298,8 @@ namespace Google.Protobuf
uint tag;
T value = codec.DefaultValue;
- while (input.ReadTag(out tag))
+ while ((tag = input.ReadTag()) != 0)
{
- if (tag == 0)
- {
- throw InvalidProtocolBufferException.InvalidTag();
- }
if (tag == codec.Tag)
{
value = codec.Read(input);