blob: c14705458c84d53a271d15d95a6624e24a808a6f [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001C99 fixes:
2
3 src/libtpm2-totp.c:172:13: error: format '%li' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
4| dbg("Calling Esys_GetRandom for %li bytes", SECRETLEN - *secret_size);
5
6src/tpm2-totp.c:343:23: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint64_t' {aka 'long long unsigned int'} [-Werror=format=]
7
8Upstream-Status: Pending
9Signed-off-by: Armin Kuster <akuster808@gmail.com>
10
11Index: git/src/libtpm2-totp.c
12===================================================================
13--- git.orig/src/libtpm2-totp.c
14+++ git/src/libtpm2-totp.c
15@@ -169,7 +169,7 @@ tpm2totp_generateKey(uint32_t pcrs, uint
16 if (rc != TPM2_RC_INITIALIZE) chkrc(rc, goto error);
17
18 while (*secret_size < SECRETLEN) {
19- dbg("Calling Esys_GetRandom for %li bytes", SECRETLEN - *secret_size);
20+ dbg("Calling Esys_GetRandom for %li bytes", (long int) (SECRETLEN - *secret_size));
21 rc = Esys_GetRandom(ctx,
22 ESYS_TR_NONE, ESYS_TR_NONE, ESYS_TR_NONE,
23 SECRETLEN - *secret_size, &t);
24Index: git/src/tpm2-totp.c
25===================================================================
26--- git.orig/src/tpm2-totp.c
27+++ git/src/tpm2-totp.c
28@@ -340,7 +340,7 @@ main(int argc, char **argv)
29 localtime (&now));
30 chkrc(rc, exit(1));
31 }
32- printf("%s%06ld", timestr, totp);
33+ printf("%s%06ld", timestr, (long int)totp);
34 break;
35 case CMD_RESEAL:
36 rc = tpm2totp_loadKey_nv(opt.nvindex, &keyBlob, &keyBlob_size);