|
|
@ -1059,7 +1059,8 @@ static void jsondec_timestamp(jsondec *d, upb_msg *msg, const upb_msgdef *m) { |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
/* [+-]08:00 or Z */ |
|
|
|
/* [+-]08:00 or Z */ |
|
|
|
int ofs = 0; |
|
|
|
int ofs_hour = 0; |
|
|
|
|
|
|
|
int ofs_min = 0; |
|
|
|
bool neg = false; |
|
|
|
bool neg = false; |
|
|
|
|
|
|
|
|
|
|
|
if (ptr == end) goto malformed; |
|
|
|
if (ptr == end) goto malformed; |
|
|
@ -1070,9 +1071,10 @@ static void jsondec_timestamp(jsondec *d, upb_msg *msg, const upb_msgdef *m) { |
|
|
|
/* fallthrough */ |
|
|
|
/* fallthrough */ |
|
|
|
case '+': |
|
|
|
case '+': |
|
|
|
if ((end - ptr) != 5) goto malformed; |
|
|
|
if ((end - ptr) != 5) goto malformed; |
|
|
|
ofs = jsondec_tsdigits(d, &ptr, 2, ":00"); |
|
|
|
ofs_hour = jsondec_tsdigits(d, &ptr, 2, ":"); |
|
|
|
ofs *= 60 * 60; |
|
|
|
ofs_min = jsondec_tsdigits(d, &ptr, 2, NULL); |
|
|
|
seconds.int64_val += (neg ? ofs : -ofs); |
|
|
|
ofs_min = ((ofs_hour * 60) + ofs_min) * 60; |
|
|
|
|
|
|
|
seconds.int64_val += (neg ? ofs_min : -ofs_min); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'Z': |
|
|
|
case 'Z': |
|
|
|
if (ptr != end) goto malformed; |
|
|
|
if (ptr != end) goto malformed; |
|
|
|