Merge pull request #155 from mithro/icetime-error

icetime: Output where the chipdb should be found.
This commit is contained in:
Clifford Wolf 2018-06-15 17:58:20 +02:00 committed by GitHub
commit 6596f00ae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -343,12 +343,14 @@ void read_chipdb()
homedir += getenv("HOME");
#endif
snprintf(buffer, 1024, "%s%s/share/" CHIPDB_SUBDIR "/chipdb-%s.txt", homedir.c_str(), PREFIX+1, config_device.c_str());
} else
} else {
snprintf(buffer, 1024, PREFIX "/share/" CHIPDB_SUBDIR "/chipdb-%s.txt", config_device.c_str());
}
FILE *fdb = fopen(buffer, "r");
if (fdb == nullptr) {
perror("Can't open chipdb file");
fprintf(stderr, " %s\n", buffer);
exit(1);
}