mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Change assert to runtime check.
I had a system that was constantly hitting this assert, after making this change it recovered immediately.
This commit is contained in:
		
				
					committed by
					
						 Christopher Haster
						Christopher Haster
					
				
			
			
				
	
			
			
			
						parent
						
							a7dfae4526
						
					
				
				
					commit
					cb26157880
				
			
							
								
								
									
										3
									
								
								lfs.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								lfs.c
									
									
									
									
									
								
							| @@ -29,8 +29,7 @@ static int lfs_bd_read(lfs_t *lfs, | ||||
|         lfs_block_t block, lfs_off_t off, | ||||
|         void *buffer, lfs_size_t size) { | ||||
|     uint8_t *data = buffer; | ||||
|     LFS_ASSERT(block != LFS_BLOCK_NULL); | ||||
|     if (off+size > lfs->cfg->block_size) { | ||||
|     if ((off+size > lfs->cfg->block_size) || (block == LFS_BLOCK_NULL)) { | ||||
|         return LFS_ERR_CORRUPT; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user