[PATCH] nitro_enclaves: Fix the wrong format specifier

From: Zhu Jun
Date: Wed Oct 09 2024 - 04:14:01 EST


The format specifier of "unsigned int" in printf() should be "%u", not
"%d".

Signed-off-by: Zhu Jun <zhujun2@xxxxxxxxxxxxxxxxxxxx>
---
samples/nitro_enclaves/ne_ioctl_sample.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/samples/nitro_enclaves/ne_ioctl_sample.c b/samples/nitro_enclaves/ne_ioctl_sample.c
index 765b131c7319..5ccb45b225e2 100644
--- a/samples/nitro_enclaves/ne_ioctl_sample.c
+++ b/samples/nitro_enclaves/ne_ioctl_sample.c
@@ -818,7 +818,7 @@ int main(int argc, char *argv[])

rc = ne_alloc_user_mem_region(&ne_user_mem_regions[i]);
if (rc < 0) {
- printf("Error in alloc userspace memory region, iter %d\n", i);
+ printf("Error in alloc userspace memory region, iter %u\n", i);

goto release_enclave_fd;
}
@@ -831,7 +831,7 @@ int main(int argc, char *argv[])
for (i = 0; i < NE_DEFAULT_NR_MEM_REGIONS; i++) {
rc = ne_set_user_mem_region(enclave_fd, ne_user_mem_regions[i]);
if (rc < 0) {
- printf("Error in set memory region, iter %d\n", i);
+ printf("Error in set memory region, iter %u\n", i);

goto release_enclave_fd;
}
@@ -847,12 +847,12 @@ int main(int argc, char *argv[])
ne_vcpus[i] = 0;
rc = ne_add_vcpu(enclave_fd, &ne_vcpus[i]);
if (rc < 0) {
- printf("Error in add vcpu, iter %d\n", i);
+ printf("Error in add vcpu, iter %u\n", i);

goto release_enclave_fd;
}

- printf("Added vCPU %d to the enclave\n", ne_vcpus[i]);
+ printf("Added vCPU %u to the enclave\n", ne_vcpus[i]);
}

printf("Enclave vCPUs were added\n");
--
2.17.1