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 @@ -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);
You can’t perform that action at this time.
0 commit comments