Skip to content

Commit e9b56f8

Browse files
committed
Fix MSVC warnings.
1 parent 27ccae4 commit e9b56f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nob.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,14 +2093,14 @@ NOBDEF bool nob_read_entire_file(const char *path, Nob_String_Builder *sb)
20932093
if (m < 0) nob_return_defer(false);
20942094
if (fseek(f, 0, SEEK_SET) < 0) nob_return_defer(false);
20952095

2096-
new_count = sb->count + m;
2096+
new_count = sb->count + (size_t)m;
20972097
if (new_count > sb->capacity) {
20982098
sb->items = NOB_DECLTYPE_CAST(sb->items)NOB_REALLOC(sb->items, new_count);
20992099
NOB_ASSERT(sb->items != NULL && "Buy more RAM lool!!");
21002100
sb->capacity = new_count;
21012101
}
21022102

2103-
fread(sb->items + sb->count, m, 1, f);
2103+
fread(sb->items + sb->count, (size_t)m, 1, f);
21042104
if (ferror(f)) {
21052105
// TODO: Afaik, ferror does not set errno. So the error reporting in defer is not correct in this case.
21062106
nob_return_defer(false);

0 commit comments

Comments
 (0)