mirror of
https://github.com/angt/secret
synced 2024-11-16 19:48:05 +01:00
Use s_write to print totp
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
parent
8f4ad7cd30
commit
387cb2ddba
1 changed files with 3 additions and 2 deletions
5
secret.c
5
secret.c
|
@ -521,8 +521,9 @@ totp(const char *secret, size_t len)
|
|||
|
||||
uint32_t ret = (load32_be(&h[h[19] & 0xF]) & ~(UINT32_C(1) << 31))
|
||||
% UINT32_C(1000000);
|
||||
|
||||
printf("%06" PRIu32, ret);
|
||||
char tmp[7];
|
||||
if (snprintf(tmp, sizeof(tmp), "%06" PRIu32, ret) == 6)
|
||||
s_write(1, tmp, 6);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in a new issue