Fix pointer-advancement bugs in MS and US cases of new to_timestamp() code.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 26 Sep 2008 15:35:28 +0000 (15:35 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 26 Sep 2008 15:35:28 +0000 (15:35 +0000)
Alex Hunsaker

src/backend/utils/adt/formatting.c

index ef2a88dae7c3deac706a8ee1c59a3705ecac756d..4c20a06d798f21509f34cfadf427057514b0a4e5 100644 (file)
@@ -2537,7 +2537,7 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
                                out->ms *= len == 1 ? 100 :
                                        len == 2 ? 10 : 1;
 
-                               s += len + SKIP_THth(n->suffix);
+                               s += SKIP_THth(n->suffix);
                                break;
                        case DCH_US:                    /* microsecond */
                                len = from_char_parse_int_len(&out->us, &s, 6, n);
@@ -2548,7 +2548,7 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
                                        len == 4 ? 100 :
                                        len == 5 ? 10 : 1;
 
-                               s += len + SKIP_THth(n->suffix);
+                               s += SKIP_THth(n->suffix);
                                break;
                        case DCH_SSSS:
                                from_char_parse_int(&out->ssss, &s, n);