Skip to content

Commit c64fb39

Browse files
committed
fbtl_posix: fix sign comparisons
Signed-off-by: Jeff Squyres <jeff@squyres.com>
1 parent b7f9221 commit c64fb39

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ompi/mca/fbtl/posix/fbtl_posix_preadv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2008-2021 University of Houston. All rights reserved.
1313
* Copyright (c) 2015-2018 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -221,11 +222,11 @@ ssize_t mca_fbtl_posix_preadv_datasieving (ompio_file_t *fh, struct flock *lock,
221222
size_t start_offset = (size_t) fh->f_io_array[startindex].offset;
222223
for ( i = startindex ; i < endindex ; i++) {
223224
pos = (size_t) fh->f_io_array[i].offset - start_offset;
224-
if ( (ssize_t) pos > total_bytes ) {
225+
if ( pos > total_bytes ) {
225226
break;
226227
}
227228
num_bytes = fh->f_io_array[i].length;
228-
if ( ((ssize_t) pos + (ssize_t)num_bytes) > total_bytes ) {
229+
if ( (pos + (size_t)num_bytes) > total_bytes ) {
229230
num_bytes = total_bytes - (ssize_t)pos;
230231
}
231232

0 commit comments

Comments
 (0)