osmo-sim-test: Use stderr for error messages
Change-Id: I8f36b07b8601af2b0d54d95c3c6374d6c54bafd1
diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c
index 27de0bc..2bf83fa 100644
--- a/utils/osmo-sim-test.c
+++ b/utils/osmo-sim-test.c
@@ -326,25 +326,25 @@
msg = select_file(chan, fid);
if (!msg) {
- printf("Unable to select file\n");
+ fprintf(stderr, "Unable to select file\n");
return -EIO;
}
printf("SW: %s\n", osim_print_sw(chan->card, msgb_apdu_sw(msg)));
if (msgb_apdu_sw(msg) != 0x9000) {
- printf("status 0x%04x selecting file\n", msgb_apdu_sw(msg));
+ fprintf(stderr, "status 0x%04x selecting file\n", msgb_apdu_sw(msg));
goto out;
}
if (g_class != 0xA0) {
rc = tlv_parse(&tp, &ts102221_fcp_tlv_def, msgb_apdu_de(msg)+2, msgb_apdu_le(msg)-2, 0, 0);
if (rc < 0) {
- printf("Unable to parse FCP: %s\n", msgb_hexdump(msg));
+ fprintf(stderr, "Unable to parse FCP: %s\n", msgb_hexdump(msg));
goto out;
}
if (!TLVP_PRESENT(&tp, UICC_FCP_T_FILE_DESC) ||
TLVP_LEN(&tp, UICC_FCP_T_FILE_DESC) < 2) {
- printf("No file descriptor present ?!?\n");
+ fprintf(stderr, "No file descriptor present ?!?\n");
goto out;
}
@@ -355,12 +355,12 @@
}
if (rc < 0) {
- printf("Unable to decode File Descriptor\n");
+ fprintf(stderr, "Unable to decode File Descriptor\n");
goto out;
}
if (ffdd.type != TYPE_EF) {
- printf("File Type != EF\n");
+ fprintf(stderr, "File Type != EF\n");
goto out;
}
@@ -384,7 +384,7 @@
i = ntohs(*(uint16_t *)TLVP_VAL(&tp, UICC_FCP_T_FILE_SIZE));
printf("File size: %d bytes\n", i);
} else {
- printf("Can not determine file size, invalid EF-type!\n");
+ fprintf(stderr, "Can not determine file size, invalid EF-type!\n");
goto out;
}
for (offset = 0; offset < i-1; ) {