FreeCalypso > hg > fc-pcsc-tools
comparison simtool/dumpdir.c @ 5:ce189c97b7b1
check_simresp_all_blank() factored out into libcommon
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Thu, 11 Feb 2021 23:31:51 +0000 |
| parents | 2071b28cd0c7 |
| children | 2c72709e0891 |
comparison
equal
deleted
inserted
replaced
| 4:744fabd6bd3f | 5:ce189c97b7b1 |
|---|---|
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include "simresp.h" | 8 #include "simresp.h" |
| 9 #include "curfile.h" | 9 #include "curfile.h" |
| 10 #include "file_id.h" | 10 #include "file_id.h" |
| 11 | |
| 12 static | |
| 13 check_all_blank() | |
| 14 { | |
| 15 u_char *dp, *endp; | |
| 16 | |
| 17 dp = sim_resp_data; | |
| 18 endp = sim_resp_data + sim_resp_data_len; | |
| 19 while (dp < endp) | |
| 20 if (*dp++ != 0xFF) | |
| 21 return(0); | |
| 22 return(1); | |
| 23 } | |
| 24 | 11 |
| 25 static void | 12 static void |
| 26 dump_aid(tlv) | 13 dump_aid(tlv) |
| 27 u_char *tlv; | 14 u_char *tlv; |
| 28 { | 15 { |
| 142 } | 129 } |
| 143 for (recno = 1; recno <= curfile_record_count; recno++) { | 130 for (recno = 1; recno <= curfile_record_count; recno++) { |
| 144 rc = readrec_op(recno, 0x04, curfile_record_len); | 131 rc = readrec_op(recno, 0x04, curfile_record_len); |
| 145 if (rc < 0) | 132 if (rc < 0) |
| 146 return(rc); | 133 return(rc); |
| 147 if (check_all_blank()) | 134 if (check_simresp_all_blank()) |
| 148 continue; | 135 continue; |
| 149 dump_record(recno); | 136 dump_record(recno); |
| 150 } | 137 } |
| 151 return(0); | 138 return(0); |
| 152 } | 139 } |
