Skip to content

Commit e3491bf

Browse files
Correct message for counting file sizes.
1 parent 22158f4 commit e3491bf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

csloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ csloc(const char *dir, csloc_filenp *dat, size_t *sz, unsigned ops, size_t cr, c
277277
#ifdef _WIN32
278278
FindFirstFileA(subdir, &fdat);
279279
ULONGLONG sz = fdat.nFileSizeHigh;
280-
sz = (sz << 32) + dat.nFileSizeLow;
280+
sz = (sz << 32) + fdat.nFileSizeLow;
281281
sfl = sz;
282282
#else
283283
if(stat(subdir, &fdat) == 0)

main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,12 @@ int main(int argl,char*argv[])
144144
fprintf(ofh, "%s %zu\n", dat[i].name, dat[i].val);
145145
}
146146
else
147-
fprintf(ofh, "File %s has %zu source lines of code.\n", dat[i].name, dat[i].val);
147+
{
148+
if(CSLOC_ISFSIZE(options))
149+
fprintf(ofh, "File %s is %zu bytes.\n", dat[i].name, dat[i].val);
150+
else
151+
fprintf(ofh, "File %s has %zu source lines of code.\n", dat[i].name, dat[i].val);
152+
}
148153
free(dat[i].name);
149154
col = col == 0 ? 36 : 0;
150155
}

0 commit comments

Comments
 (0)