mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 16:14:16 +01:00 
			
		
		
		
	lfs_remove: Cast tag/error return codes to int.
For correctness, cast the lfs_stag_t variables to int when returning a negative error code.
This commit is contained in:
		
							
								
								
									
										4
									
								
								lfs.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								lfs.c
									
									
									
									
									
								
							| @@ -3097,7 +3097,7 @@ int lfs_remove(lfs_t *lfs, const char *path) { | |||||||
|     lfs_stag_t tag = lfs_dir_find(lfs, &cwd, &path, NULL); |     lfs_stag_t tag = lfs_dir_find(lfs, &cwd, &path, NULL); | ||||||
|     if (tag < 0 || lfs_tag_id(tag) == 0x3ff) { |     if (tag < 0 || lfs_tag_id(tag) == 0x3ff) { | ||||||
|         LFS_TRACE("lfs_remove -> %d", (tag < 0) ? tag : LFS_ERR_INVAL); |         LFS_TRACE("lfs_remove -> %d", (tag < 0) ? tag : LFS_ERR_INVAL); | ||||||
|         return (tag < 0) ? tag : LFS_ERR_INVAL; |         return (tag < 0) ? (int)tag : LFS_ERR_INVAL; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     lfs_mdir_t dir; |     lfs_mdir_t dir; | ||||||
| @@ -3108,7 +3108,7 @@ int lfs_remove(lfs_t *lfs, const char *path) { | |||||||
|                 LFS_MKTAG(LFS_TYPE_STRUCT, lfs_tag_id(tag), 8), pair); |                 LFS_MKTAG(LFS_TYPE_STRUCT, lfs_tag_id(tag), 8), pair); | ||||||
|         if (res < 0) { |         if (res < 0) { | ||||||
|             LFS_TRACE("lfs_remove -> %d", res); |             LFS_TRACE("lfs_remove -> %d", res); | ||||||
|             return res; |             return (int)res; | ||||||
|         } |         } | ||||||
|         lfs_pair_fromle32(pair); |         lfs_pair_fromle32(pair); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user