vfs: introduce adjustable ISO9660 buffer length for file reading
This commit is contained in:
+4
-4
@@ -71,9 +71,9 @@ size_t vfs_read_file(l9660_file *file, uint8_t* buffer)
|
||||
l9660_status status;
|
||||
|
||||
for(;;) {
|
||||
char buf[128];
|
||||
char buf[ISO_9660_BUFFER_LENGTH];
|
||||
size_t read;
|
||||
status = l9660_read(file, buf, 128, &read);
|
||||
status = l9660_read(file, buf, ISO_9660_BUFFER_LENGTH, &read);
|
||||
|
||||
if (status != L9660_OK) {
|
||||
printf("An error occurred during file read!\n");
|
||||
@@ -97,8 +97,8 @@ size_t vfs_read_file_length(l9660_file *file, uint8_t* buffer, size_t length)
|
||||
l9660_status status;
|
||||
|
||||
while(total_read < length) {
|
||||
char buf[128];
|
||||
size_t to_read = (length - total_read) < 128 ? (length - total_read) : 128;
|
||||
char buf[ISO_9660_BUFFER_LENGTH];
|
||||
size_t to_read = (length - total_read) < ISO_9660_BUFFER_LENGTH ? (length - total_read) : ISO_9660_BUFFER_LENGTH;
|
||||
size_t read = 0;
|
||||
|
||||
status = l9660_read(file, buf, to_read, &read);
|
||||
|
||||
Reference in New Issue
Block a user