Commit 7688f8dc authored by Uri Blumenthal's avatar Uri Blumenthal

Merge remote-tracking branch 'upstream/pr/275' into vlm_master

parents 653e0857 1e67d68f
...@@ -617,7 +617,7 @@ asn_time2GT_frac(GeneralizedTime_t *opt_gt, const struct tm *tm, int frac_value, ...@@ -617,7 +617,7 @@ asn_time2GT_frac(GeneralizedTime_t *opt_gt, const struct tm *tm, int frac_value,
const unsigned int buf_size = const unsigned int buf_size =
4 + 2 + 2 /* yyyymmdd */ 4 + 2 + 2 /* yyyymmdd */
+ 2 + 2 + 2 /* hhmmss */ + 2 + 2 + 2 /* hhmmss */
+ 1 + 6 /* .ffffff */ + 1 + 9 /* .fffffffff */
+ 1 + 4 /* +hhmm */ + 1 + 4 /* +hhmm */
+ 1 /* '\0' */ + 1 /* '\0' */
; ;
...@@ -670,13 +670,13 @@ asn_time2GT_frac(GeneralizedTime_t *opt_gt, const struct tm *tm, int frac_value, ...@@ -670,13 +670,13 @@ asn_time2GT_frac(GeneralizedTime_t *opt_gt, const struct tm *tm, int frac_value,
* Deal with fractions. * Deal with fractions.
*/ */
if(frac_value > 0 && frac_digits > 0) { if(frac_value > 0 && frac_digits > 0) {
char *end = p + 1 + 6; /* '.' + maximum 6 digits */ char *end = p + 1 + 9; /* '.' + maximum 9 digits */
char *z = p; char *z = p;
long fbase; long fbase;
*z++ = '.'; *z++ = '.';
/* Place bounds on precision */ /* Place bounds on precision */
while(frac_digits-- > 6) while(frac_digits-- > 9)
frac_value /= 10; frac_value /= 10;
/* emulate fbase = pow(10, frac_digits) */ /* emulate fbase = pow(10, frac_digits) */
......
...@@ -264,19 +264,20 @@ main(int ac, char **av) { ...@@ -264,19 +264,20 @@ main(int ac, char **av) {
RECODE("20050702123312,30000+01", "20050702113312.3Z"); RECODE("20050702123312,30000+01", "20050702113312.3Z");
RECODE("20050702123312,300000000+01", "20050702113312.3Z"); RECODE("20050702123312,300000000+01", "20050702113312.3Z");
RECODE("20050702123312.123456+01", "20050702113312.123456Z"); RECODE("20050702123312.123456+01", "20050702113312.123456Z");
RECODE("20050702123312.1234567+01", "20050702113312.123456Z"); RECODE("20050702123312.1234567+01", "20050702113312.1234567Z");
RECODE("20050702123312.12345678+01", "20050702113312.123456Z"); RECODE("20050702123312.12345678+01", "20050702113312.12345678Z");
RECODE("20050702123312.123456789+01", "20050702113312.123456Z"); RECODE("20050702123312.123456789+01", "20050702113312.123456789Z");
RECODE("20050702123312.1234567891+01", "20050702113312.123456789Z");
RECODE("20050702123312.2000000000+01", "20050702113312.2Z"); RECODE("20050702123312.2000000000+01", "20050702113312.2Z");
RECODE("20050702123312.3000000000+01", "20050702113312.3Z"); RECODE("20050702123312.3000000000+01", "20050702113312.3Z");
RECODE("20050702123312.4000000000+01", "20050702113312.4Z"); RECODE("20050702123312.4000000000+01", "20050702113312.4Z");
RECODE("20050702123312.5000000000+01", "20050702113312.5Z"); RECODE("20050702123312.5000000000+01", "20050702113312.5Z");
RECODE("20050702123312.5000000011+01", "20050702113312.500000001Z");
RECODE("20050702123312.5000000001+01", "20050702113312.5Z"); RECODE("20050702123312.5000000001+01", "20050702113312.5Z");
RECODE("20050702123312.5000010001+01", "20050702113312.500001Z"); RECODE("20050702123312.000000001+01", "20050702113312.000000001Z");
RECODE("20050702123312.5000001001+01", "20050702113312.5Z"); RECODE("20050702123312.0000000001Z", "20050702123312Z");
RECODE("20050702123312.000001+01", "20050702113312.000001Z"); RECODE("20050702123312.0000000100Z", "20050702123312.00000001Z");
RECODE("20050702123312.0000001Z", "20050702123312Z"); RECODE("20050702123312.0080000010+1056", "20050702013712.008000001Z");
RECODE("20050702123312.0080010+1056", "20050702013712.008001Z");
#endif #endif
compare(__LINE__, 0, "20040125093007", "20040125093007"); compare(__LINE__, 0, "20040125093007", "20040125093007");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment