laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/17551 )


Change subject: osmo-sim-test: Use stderr for error messages
......................................................................

osmo-sim-test: Use stderr for error messages

Change-Id: I8f36b07b8601af2b0d54d95c3c6374d6c54bafd1
---
M utils/osmo-sim-test.c
1 file changed, 7 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/51/17551/1

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; ) {

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17551
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8f36b07b8601af2b0d54d95c3c6374d6c54bafd1
Gerrit-Change-Number: 17551
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-MessageType: newchange

Reply via email to