mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
cmsfs-fuse: do not check if unsigned is less than zero
Only check if size is zero and not if equal or less than zero. This is safe, as size is only decremented by rlen, which is either less than or equal to size. So size may never overflow. Resolves Cppcheck style warning: [cmsfs-fuse/cmsfs-fuse.c:3746]: (style) Checking if unsigned variable 'size' is less than zero. Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Jens Remus <jremus@linux.ibm.com> Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -3741,7 +3741,7 @@ static int extend_block_variable(struct file *f, const char *buf, int len,
|
||||
}
|
||||
|
||||
DEBUG("%s: wrote %d record bytes\n", __func__, rlen);
|
||||
if (size <= 0)
|
||||
if (size == 0)
|
||||
return copied;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user