| 191 | return res; |
| 192 | } |
| 193 | void FileReadArr(NULLCArray arr, unsigned offset, unsigned count, File* file) |
| 194 | { |
| 195 | if(!file->handle) |
| 196 | { |
| 197 | nullcThrowError("Cannot read from a closed file."); |
| 198 | return; |
| 199 | } |
| 200 | if((long long)count + offset > arr.len) |
| 201 | { |
| 202 | nullcThrowError("Array can't hold %d bytes from the specified offset.", count); |
| 203 | return; |
| 204 | } |
| 205 | if(count != fread(arr.ptr + offset, 1, count, file->handle)) |
| 206 | nullcThrowError("Failed to read from a file."); |
| 207 | } |
| 208 | void FileWriteArr(NULLCArray arr, unsigned offset, unsigned count, File* file) |
| 209 | { |
| 210 | if(!file->handle) |
nothing calls this directly
no test coverage detected