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 @@ -2087,14 +2087,14 @@ NOBDEF bool nob_read_entire_file(const char *path, Nob_String_Builder *sb)
20872087 if (m < 0 ) nob_return_defer (false);
20882088 if (fseek (f , 0 , SEEK_SET ) < 0 ) nob_return_defer (false);
20892089
2090- new_count = sb -> count + m ;
2090+ new_count = sb -> count + ( size_t ) m ;
20912091 if (new_count > sb -> capacity ) {
20922092 sb -> items = NOB_DECLTYPE_CAST (sb -> items )NOB_REALLOC (sb -> items , new_count );
20932093 NOB_ASSERT (sb -> items != NULL && "Buy more RAM lool!!" );
20942094 sb -> capacity = new_count ;
20952095 }
20962096
2097- fread (sb -> items + sb -> count , m , 1 , f );
2097+ fread (sb -> items + sb -> count , ( size_t ) m , 1 , f );
20982098 if (ferror (f )) {
20992099 // TODO: Afaik, ferror does not set errno. So the error reporting in defer is not correct in this case.
21002100 nob_return_defer (false);
You can’t perform that action at this time.
0 commit comments