spy: display -1 instead of 18446744073709551615

buf_len is a CK_ULONG (unsigned long). But if the attribute is sensitive
or is not extractable or is invalid for the object then the library set
the buffer length value to (CK_LONG)-1.

It is more friendly to see "-1" instead of "18446744073709551615" (on
64-bits CPU)
This commit is contained in:
Ludovic Rousseau 2019-08-26 10:37:06 +02:00
parent 43a8f870e5
commit 2240abcef1
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ buf_spec(CK_VOID_PTR buf_addr, CK_ULONG buf_len)
#if !defined(_MSC_VER) || _MSC_VER >= 1800
const size_t prwidth = sizeof(CK_VOID_PTR) * 2;
sprintf(ret, "%0*"PRIxPTR" / %lu", (int) prwidth, (uintptr_t) buf_addr,
sprintf(ret, "%0*"PRIxPTR" / %ld", (int) prwidth, (uintptr_t) buf_addr,
buf_len);
#else
if (sizeof(CK_VOID_PTR) == 4)