Negative r has a meaning in the cached file logic, so be sure to reset it to -1

after sc_print_path has returned a value.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2819 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
martin 2006-01-23 17:29:59 +00:00
parent b07df40932
commit 723888d623
2 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ int sc_pkcs15_read_cached_file(struct sc_pkcs15_card *p15card,
*bufsize = count;
if (data)
*buf = data;
return 0;
return 0;
}
int sc_pkcs15_cache_file(struct sc_pkcs15_card *p15card,

View File

@ -1519,7 +1519,7 @@ int sc_pkcs15_read_file(struct sc_pkcs15_card *p15card,
sc_path_t tmp_path, *path = &tmp_path;
u8 *data = NULL;
size_t len = 0, offset = 0;
int r = -1;
int r;
assert(p15card != NULL && in_path != NULL && buf != NULL);
@ -1543,7 +1543,7 @@ int sc_pkcs15_read_file(struct sc_pkcs15_card *p15card,
} else {
memcpy(path, in_path, sizeof(sc_path_t));
}
r = -1; /* file state: not in cache */
if (p15card->opts.use_cache) {
r = sc_pkcs15_read_cached_file(p15card, path, &data, &len);
}