Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
ec8101d2
Commit
ec8101d2
authored
Apr 25, 2018
by
Russ Kubik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase GeneralizedTime fractional second precision to 9 digits
parent
4cc779fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
skeletons/GeneralizedTime.c
skeletons/GeneralizedTime.c
+2
-2
tests/tests-skeletons/check-GeneralizedTime.c
tests/tests-skeletons/check-GeneralizedTime.c
+8
-8
No files found.
skeletons/GeneralizedTime.c
View file @
ec8101d2
...
...
@@ -666,13 +666,13 @@ asn_time2GT_frac(GeneralizedTime_t *opt_gt, const struct tm *tm, int frac_value,
* Deal with fractions.
*/
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
;
long
fbase
;
*
z
++
=
'.'
;
/* Place bounds on precision */
while
(
frac_digits
--
>
6
)
while
(
frac_digits
--
>
9
)
frac_value
/=
10
;
/* emulate fbase = pow(10, frac_digits) */
...
...
tests/tests-skeletons/check-GeneralizedTime.c
View file @
ec8101d2
...
...
@@ -264,19 +264,19 @@ main(int ac, char **av) {
RECODE
(
"20050702123312,30000+01"
,
"20050702113312.3Z"
);
RECODE
(
"20050702123312,300000000+01"
,
"20050702113312.3Z"
);
RECODE
(
"20050702123312.123456+01"
,
"20050702113312.123456Z"
);
RECODE
(
"20050702123312.1234567+01"
,
"20050702113312.123456Z"
);
RECODE
(
"20050702123312.12345678+01"
,
"20050702113312.123456Z"
);
RECODE
(
"20050702123312.123456789+01"
,
"20050702113312.123456Z"
);
RECODE
(
"20050702123312.1234567+01"
,
"20050702113312.1234567Z"
);
RECODE
(
"20050702123312.12345678+01"
,
"20050702113312.12345678Z"
);
RECODE
(
"20050702123312.123456789+01"
,
"20050702113312.123456789Z"
);
RECODE
(
"20050702123312.1234567891+01"
,
"20050702113312.123456789Z"
);
RECODE
(
"20050702123312.2000000000+01"
,
"20050702113312.2Z"
);
RECODE
(
"20050702123312.3000000000+01"
,
"20050702113312.3Z"
);
RECODE
(
"20050702123312.4000000000+01"
,
"20050702113312.4Z"
);
RECODE
(
"20050702123312.5000000000+01"
,
"20050702113312.5Z"
);
RECODE
(
"20050702123312.5000000011+01"
,
"20050702113312.500000001Z"
);
RECODE
(
"20050702123312.5000000001+01"
,
"20050702113312.5Z"
);
RECODE
(
"20050702123312.5000010001+01"
,
"20050702113312.500001Z"
);
RECODE
(
"20050702123312.5000001001+01"
,
"20050702113312.5Z"
);
RECODE
(
"20050702123312.000001+01"
,
"20050702113312.000001Z"
);
RECODE
(
"20050702123312.0000001Z"
,
"20050702123312Z"
);
RECODE
(
"20050702123312.0080010+1056"
,
"20050702013712.008001Z"
);
RECODE
(
"20050702123312.000000001+01"
,
"20050702113312.000000001Z"
);
RECODE
(
"20050702123312.0000000001Z"
,
"20050702123312Z"
);
RECODE
(
"20050702123312.0080000010+1056"
,
"20050702013712.008000001Z"
);
#endif
compare
(
__LINE__
,
0
,
"20040125093007"
,
"20040125093007"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment