- dont barf on empty directories

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1522 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-10-14 10:10:24 +00:00
parent 7d7e07998d
commit e968abd1a1
1 changed files with 4 additions and 1 deletions

View File

@ -247,10 +247,13 @@ int enum_dir(struct sc_path path, int depth)
int i;
r = sc_list_files(card, files, sizeof(files));
if (r <= 0) {
if (r < 0) {
fprintf(stderr, "sc_list_files() failed: %s\n", sc_strerror(r));
return 1;
}
if (r == 0) {
printf("Empty directory\n");
} else
for (i = 0; i < r/2; i++) {
struct sc_path tmppath;