opensc tools: to be compiled with Visual Studio

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4716 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
viktor.tarasov 2010-09-13 08:08:42 +00:00
parent 19df2c812b
commit 8aa2a64261
2 changed files with 11 additions and 10 deletions

View File

@ -1,7 +1,7 @@
TOPDIR = ..\.. TOPDIR = ..\..
TARGET = common.lib TARGET = common.lib
OBJECTS = compat_getpass.obj compat_getopt.obj compat_strlcpy.obj simclist.obj OBJECTS = compat_getpass.obj compat_getopt.obj compat_strlcpy.obj compat_strlcat.obj simclist.obj
all: $(TARGET) all: $(TARGET)

View File

@ -368,6 +368,8 @@ static int do_cat(int argc, char **argv)
goto err; goto err;
} }
} else { } else {
const char *sfi_n = &argv[0][sizeof(sfi_prefix)-1];
if(!current_file) { if(!current_file) {
printf("A DF must be selected to read by SFI\n"); printf("A DF must be selected to read by SFI\n");
goto err; goto err;
@ -375,7 +377,6 @@ static int do_cat(int argc, char **argv)
path = current_path; path = current_path;
file = current_file; file = current_file;
not_current = 0; not_current = 0;
const char *sfi_n = &argv[0][sizeof(sfi_prefix)-1];
sfi = atoi(sfi_n); sfi = atoi(sfi_n);
if ((sfi < 1) || (sfi > 30)) { if ((sfi < 1) || (sfi > 30)) {
printf("Invalid SFI: %s\n", sfi_n); printf("Invalid SFI: %s\n", sfi_n);
@ -1565,6 +1566,7 @@ int main(int argc, char * const argv[])
int cargc; int cargc;
char *cargv[260]; char *cargv[260];
sc_context_param_t ctx_param; sc_context_param_t ctx_param;
int lcycle = SC_CARDCTRL_LIFECYCLE_ADMIN;
printf("OpenSC Explorer version %s\n", sc_get_version()); printf("OpenSC Explorer version %s\n", sc_get_version());
@ -1621,8 +1623,9 @@ int main(int argc, char * const argv[])
if (opt_startfile) { if (opt_startfile) {
if(*opt_startfile) { if(*opt_startfile) {
char startpath[1024]; char startpath[1024];
strncpy(startpath, opt_startfile, sizeof(startpath)-1);
char *argv[] = { startpath }; char *argv[] = { startpath };
strncpy(startpath, opt_startfile, sizeof(startpath)-1);
r = do_cd(1, argv); r = do_cd(1, argv);
if (r) { if (r) {
printf("unable to select file %s: %s\n", printf("unable to select file %s: %s\n",
@ -1638,13 +1641,11 @@ int main(int argc, char * const argv[])
return 1; return 1;
} }
} }
{
int lcycle = SC_CARDCTRL_LIFECYCLE_ADMIN; r = sc_card_ctl(card, SC_CARDCTL_LIFECYCLE_SET, &lcycle);
r = sc_card_ctl(card, SC_CARDCTL_LIFECYCLE_SET, &lcycle); if (r && r != SC_ERROR_NOT_SUPPORTED)
if (r && r != SC_ERROR_NOT_SUPPORTED) printf("unable to change lifecycle: %s\n", sc_strerror(r));
printf("unable to change lifecycle: %s\n",
sc_strerror(r));
}
while (1) { while (1) {
struct command *cmd; struct command *cmd;
size_t i; size_t i;