Skip to content

Commit 83e7b35

Browse files
committed
Fix MSVC warnings.
1 parent f45f4c9 commit 83e7b35

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
@@ -2118,14 +2118,14 @@ NOBDEF bool nob_read_entire_file(const char *path, Nob_String_Builder *sb)
21182118
if (m < 0) nob_return_defer(false);
21192119
if (fseek(f, 0, SEEK_SET) < 0) nob_return_defer(false);
21202120

2121-
new_count = sb->count + m;
2121+
new_count = sb->count + (size_t)m;
21222122
if (new_count > sb->capacity) {
21232123
sb->items = NOB_DECLTYPE_CAST(sb->items)NOB_REALLOC(sb->items, new_count);
21242124
NOB_ASSERT(sb->items != NULL && "Buy more RAM lool!!");
21252125
sb->capacity = new_count;
21262126
}
21272127

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

0 commit comments

Comments
 (0)