diff options
author | Nikias Bassen | 2020-01-14 02:54:01 +0100 |
---|---|---|
committer | Nikias Bassen | 2020-01-14 02:54:01 +0100 |
commit | 1c2f7ad5e409a5ad38bf01a10501344f58a2d87b (patch) | |
tree | 2f5a10c4cd9596cfea48a1a0da5f7d726571876f /tools/irecovery.c | |
parent | db36196d8d9db5a1f92e6934cf931cd00a6ead2d (diff) | |
download | libirecovery-1c2f7ad5e409a5ad38bf01a10501344f58a2d87b.tar.gz libirecovery-1c2f7ad5e409a5ad38bf01a10501344f58a2d87b.tar.bz2 |
Use PRI* and SCN* (inttypes.h) format string macros instead of self-defined ones
... also print all values in irecovery as hex with 0x prefix to make it clear they are hex
Diffstat (limited to 'tools/irecovery.c')
-rw-r--r-- | tools/irecovery.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/irecovery.c b/tools/irecovery.c index 6ee89b0..91d1d48 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c @@ -2,7 +2,7 @@ * irecovery.c * Software frontend for iBoot/iBSS communication with iOS devices * - * Copyright (c) 2012-2019 Nikias Bassen <nikias@gmx.li> + * Copyright (c) 2012-2020 Nikias Bassen <nikias@gmx.li> * Copyright (c) 2012-2015 Martin Szulecki <martin.szulecki@libimobiledevice.org> * Copyright (c) 2010-2011 Chronic-Dev Team * Copyright (c) 2010-2011 Joshua Hill @@ -27,6 +27,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <inttypes.h> #include <libirecovery.h> #include <readline/readline.h> #include <readline/history.h> @@ -36,9 +37,6 @@ #ifndef sleep #define sleep(n) Sleep(1000 * n) #endif -#define _FMT_lld "%I64d" -#else -#define _FMT_lld "%lld" #endif #define FILE_HISTORY_PATH ".irecovery" @@ -134,13 +132,13 @@ static void print_device_info(irecv_client_t client) int ret, mode; const struct irecv_device_info *devinfo = irecv_get_device_info(client); if (devinfo) { - printf("CPID: %04x\n", devinfo->cpid); - printf("CPRV: %02x\n", devinfo->cprv); - printf("BDID: %02x\n", devinfo->bdid); - printf("ECID: " _FMT_lld "\n", devinfo->ecid); - printf("CPFM: %02x\n", devinfo->cpfm); - printf("SCEP: %02x\n", devinfo->scep); - printf("IBFL: %02x\n", devinfo->ibfl); + printf("CPID: 0x%04x\n", devinfo->cpid); + printf("CPRV: 0x%02x\n", devinfo->cprv); + printf("BDID: 0x%02x\n", devinfo->bdid); + printf("ECID: 0x%016" PRIx64 "\n", devinfo->ecid); + printf("CPFM: 0x%02x\n", devinfo->cpfm); + printf("SCEP: 0x%02x\n", devinfo->scep); + printf("IBFL: 0x%02x\n", devinfo->ibfl); printf("SRTG: %s\n", (devinfo->srtg) ? devinfo->srtg : "N/A"); printf("SRNM: %s\n", (devinfo->srnm) ? devinfo->srnm : "N/A"); printf("IMEI: %s\n", (devinfo->imei) ? devinfo->imei : "N/A"); |