diff options
author | Adam Cozzette <acozzette@gmail.com> | 2018-01-08 10:40:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-08 10:40:08 -0800 |
commit | d4afdba83d19fded7822324a7f8e68648d296260 (patch) | |
tree | 24ad5df48780c487c697083c4e1e0eda16604f9b | |
parent | bab843b8b96757ed2138fdc01dc5d82d47a2239c (diff) | |
parent | 473c5cff764b879be1f4afefb71d6b8ba0b8a9d3 (diff) | |
download | protobuf-d4afdba83d19fded7822324a7f8e68648d296260.tar.gz protobuf-d4afdba83d19fded7822324a7f8e68648d296260.tar.bz2 protobuf-d4afdba83d19fded7822324a7f8e68648d296260.zip |
Merge pull request #4147 from datacompboy/patch-1
Fix ValidateDateTime: check day instead month
-rw-r--r-- | src/google/protobuf/stubs/time.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/google/protobuf/stubs/time.cc b/src/google/protobuf/stubs/time.cc index 49c0412c..6def637e 100644 --- a/src/google/protobuf/stubs/time.cc +++ b/src/google/protobuf/stubs/time.cc @@ -80,9 +80,9 @@ bool ValidateDateTime(const DateTime& time) { return false; } if (time.month == 2 && IsLeapYear(time.year)) { - return time.month <= kDaysInMonth[time.month] + 1; + return time.day <= kDaysInMonth[time.month] + 1; } else { - return time.month <= kDaysInMonth[time.month]; + return time.day <= kDaysInMonth[time.month]; } } |