Skip to content
This repository was archived by the owner on Dec 27, 2020. It is now read-only.

Commit 259ab2e

Browse files
committed
MKLAB: Fix a few warnings and use the correct d_type
1 parent f2f166f commit 259ab2e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/mklab.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void countFiles(std::vector<std::string> &files, lab_header *head, DIR *d
8484
continue;
8585
}
8686

87-
if (dirfile->d_type == S_IFDIR) {
87+
if (dirfile->d_type == DT_DIR) {
8888
std::string nextsub = subdirn;
8989
nextsub += dirfile->d_name;
9090
nextsub += "/";
@@ -231,7 +231,7 @@ int main(int argc, char **argv) {
231231

232232
FILE *file = fopen(path.c_str(), "rb");
233233

234-
uint32_t offset = READ_LE_UINT32(&entry.start);
234+
uint32_t file_offset = READ_LE_UINT32(&entry.start);
235235
uint32_t size = READ_LE_UINT32(&entry.size);
236236

237237
if (size > bufsize) {
@@ -247,7 +247,7 @@ int main(int argc, char **argv) {
247247

248248

249249
fread(buf, 1, size, file);
250-
fseek(outfile, offset, SEEK_SET);
250+
fseek(outfile, file_offset, SEEK_SET);
251251
fwrite(buf, 1, size, outfile);
252252

253253
fclose(file);

0 commit comments

Comments
 (0)