Skip to content

Commit fac214e

Browse files
committed
fix a minor logic error
1 parent 9268a4e commit fac214e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vito_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ int vito_read( int location, int size, uint8_t *vitomem )
339339
if ( flag > 0 )
340340
{
341341
bzero( vitomem, size );
342-
if ( errorcount++ > MAX_ERRORS )
342+
if ( ++errorcount >= MAX_ERRORS )
343343
exit(2);
344344
return -1;
345345
}
@@ -421,7 +421,7 @@ int vito_write( int location, int size, uint8_t *vitomem )
421421

422422
if ( flag > 0 )
423423
{
424-
if ( errorcount++ > MAX_ERRORS )
424+
if ( ++errorcount >= MAX_ERRORS )
425425
exit(2);
426426
return -1;
427427
}

0 commit comments

Comments
 (0)