summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/file.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index c09a7fea6e..623e898257 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -468,7 +468,8 @@ static int readwrite(int fd, void* buf, int count, bool write)
468 /* read/write whole sectors right into/from the supplied buffer */ 468 /* read/write whole sectors right into/from the supplied buffer */
469 sectors = count / SECTOR_SIZE; 469 sectors = count / SECTOR_SIZE;
470 if ( sectors ) { 470 if ( sectors ) {
471 int rc = fat_readwrite(&(file->fatfile), sectors, buf+nread, write ); 471 int rc = fat_readwrite(&(file->fatfile), sectors,
472 (unsigned char*)buf+nread, write );
472 if ( rc < 0 ) { 473 if ( rc < 0 ) {
473 DEBUGF("Failed read/writing %d sectors\n",sectors); 474 DEBUGF("Failed read/writing %d sectors\n",sectors);
474 errno = EIO; 475 errno = EIO;
@@ -526,7 +527,7 @@ static int readwrite(int fd, void* buf, int count, bool write)
526 return nread ? nread : rc * 10 - 6; 527 return nread ? nread : rc * 10 - 6;
527 } 528 }
528 } 529 }
529 memcpy( file->cache, buf + nread, count ); 530 memcpy( file->cache, (unsigned char*)buf + nread, count );
530 file->dirty = true; 531 file->dirty = true;
531 } 532 }
532 else { 533 else {
@@ -538,7 +539,7 @@ static int readwrite(int fd, void* buf, int count, bool write)
538 file->cacheoffset = -1; 539 file->cacheoffset = -1;
539 return nread ? nread : rc * 10 - 7; 540 return nread ? nread : rc * 10 - 7;
540 } 541 }
541 memcpy( buf + nread, file->cache, count ); 542 memcpy( (unsigned char*)buf + nread, file->cache, count );
542 } 543 }
543 544
544 nread += count; 545 nread += count;