diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-04-16 17:46:24 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-04-16 17:46:24 +0000 |
commit | 6d793391d85600ca2e80272be42c3b08c3525e6c (patch) | |
tree | c411284fdb7b32aa3119a5c7a12a029ee966fbc8 /lib/libcrypto | |
parent | 77df2e7f95e8f10496df634a2ef8c709fce01a18 (diff) |
Zero-pad usec format to handle values less than 100,000 correctly
ok matthew@ tedu@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/ts/ts_rsp_sign.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libcrypto/ts/ts_rsp_sign.c b/lib/libcrypto/ts/ts_rsp_sign.c index 235c0a8476c..e7186a8ce01 100644 --- a/lib/libcrypto/ts/ts_rsp_sign.c +++ b/lib/libcrypto/ts/ts_rsp_sign.c @@ -983,7 +983,7 @@ TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time, if the elements correspond to 0, they MUST be wholly omitted, and the decimal point element also MUST be omitted." */ - (void)snprintf(usecstr, sizeof(usecstr), ".%ld", usec); + (void)snprintf(usecstr, sizeof(usecstr), ".%06ld", usec); /* truncate and trim trailing 0 */ usecstr[precision + 1] = '\0'; p = usecstr + strlen(usecstr) - 1; |