File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments