left-pad TOTP code with 0s

This commit is contained in:
Christian Grothoff 2023-04-02 14:12:13 +02:00
parent e99450e2e2
commit 979ec38ec4
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -189,7 +189,7 @@ executive_totp (void *h_key,
if (NULL == ret)
{
GNUNET_asprintf (&ret,
"%llu",
"%08llu",
(unsigned long long) code);
}
else
@ -197,7 +197,7 @@ executive_totp (void *h_key,
char *tmp;
GNUNET_asprintf (&tmp,
"%s\n%llu",
"%s\n%08llu",
ret,
(unsigned long long) code);
GNUNET_free (ret);