Skip to content

Commit

Permalink
Fix ruby conformance test on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
TeBoring committed Mar 28, 2019
1 parent 2d9507e commit 262cc06
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ruby/ext/google/protobuf_c/upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -14302,7 +14302,7 @@ static void start_timestamp_zone(upb_json_parser *p, const char *ptr) {
static bool end_timestamp_zone(upb_json_parser *p, const char *ptr) {
size_t len;
const char *buf;
int hours;
int hours = 0;
int64_t seconds;
const char *seconds_membername = "seconds";

Expand All @@ -14322,12 +14322,11 @@ static bool end_timestamp_zone(upb_json_parser *p, const char *ptr) {
if (buf[0] == '+') {
hours = -hours;
}

p->tm.tm_hour += hours;
}

/* Normalize tm */
seconds = mktime(&p->tm);
seconds = timegm(&p->tm);
seconds += 3600 * hours;

/* Check timestamp boundary */
if (seconds < -62135596800) {
Expand Down

0 comments on commit 262cc06

Please sign in to comment.