Fix compiler warnings

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@161 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aet 2002-01-15 18:54:53 +00:00
parent 452b9d4193
commit fec2138523
2 changed files with 10 additions and 9 deletions

View File

@ -183,7 +183,7 @@ int sc_pkcs15_create_tokeninfo(struct sc_pkcs15_card *card)
int r; int r;
u8 *buf; u8 *buf;
size_t buflen; size_t buflen;
u8 line[10240]; char line[10240];
r = encode_tokeninfo(card, &buf, &buflen); r = encode_tokeninfo(card, &buf, &buflen);
if (r) { if (r) {
@ -308,7 +308,7 @@ int sc_pkcs15_create_dir(struct sc_pkcs15_card *p15card)
u8 *buf; u8 *buf;
size_t bufsize; size_t bufsize;
int r; int r;
u8 line[10240]; char line[10240];
SC_FUNC_CALLED(card->ctx, 1); SC_FUNC_CALLED(card->ctx, 1);
sc_format_path("3F00", &path); sc_format_path("3F00", &path);
@ -440,7 +440,7 @@ int sc_pkcs15_create_odf(struct sc_pkcs15_card *p15card)
{ {
u8 *buf; u8 *buf;
size_t buflen; size_t buflen;
u8 line[10240]; char line[10240];
int r; int r;
r = encode_odf(p15card, &buf, &buflen); r = encode_odf(p15card, &buf, &buflen);

View File

@ -380,11 +380,12 @@ int do_create(const char *arg, const char *arg2)
{ {
struct sc_path path; struct sc_path path;
struct sc_file file; struct sc_file file;
size_t size; int size;
int i, r; int i, r;
if (arg_to_path(arg, &path) != 0) if (arg_to_path(arg, &path) != 0)
goto usage; goto usage;
/* %z isn't supported everywhere */
if (sscanf(arg2, "%d", &size) != 1) if (sscanf(arg2, "%d", &size) != 1)
goto usage; goto usage;
memset(&file, 0, sizeof(file)); memset(&file, 0, sizeof(file));
@ -393,7 +394,7 @@ int do_create(const char *arg, const char *arg2)
file.ef_structure = SC_FILE_EF_TRANSPARENT; file.ef_structure = SC_FILE_EF_TRANSPARENT;
for (i = 0; i < SC_MAX_AC_OPS; i++) for (i = 0; i < SC_MAX_AC_OPS; i++)
file.acl[i] = SC_AC_NONE; file.acl[i] = SC_AC_NONE;
file.size = size; file.size = (size_t) size;
file.status = SC_FILE_STATUS_ACTIVATED; file.status = SC_FILE_STATUS_ACTIVATED;
r = sc_create_file(card, &file); r = sc_create_file(card, &file);
@ -506,8 +507,8 @@ int do_get(const char *arg, const char *arg2)
if (strlen(arg2)) if (strlen(arg2))
filename = arg2; filename = arg2;
else { else {
sprintf(buf, "%02X%02X", path.value[0], path.value[1]); sprintf((char *) buf, "%02X%02X", path.value[0], path.value[1]);
filename = buf; filename = (char *) buf;
} }
outf = fopen(filename, "w"); outf = fopen(filename, "w");
if (outf == NULL) { if (outf == NULL) {
@ -569,8 +570,8 @@ int do_put(const char *arg, const char *arg2)
if (strlen(arg2)) if (strlen(arg2))
filename = arg2; filename = arg2;
else { else {
sprintf(buf, "%02X%02X", path.value[0], path.value[1]); sprintf((char *) buf, "%02X%02X", path.value[0], path.value[1]);
filename = buf; filename = (char *) buf;
} }
outf = fopen(filename, "r"); outf = fopen(filename, "r");
if (outf == NULL) { if (outf == NULL) {