Skip to content

Commit

Permalink
Fix greater-than-or-equal-to-zero issue
Browse files Browse the repository at this point in the history
unsigned_compare: This greater-than-or-equal-to-zero comparison without a signed value is always true. ndx >= 0U

Signed-off-by: Shoukui Zhang <[email protected]>
  • Loading branch information
Zhangshoukui authored and raiden00pl committed Sep 20, 2024
1 parent 44cce29 commit 2c543c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/libc/tls/tls_cleanup.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void tls_cleanup_pop(FAR struct tls_info_s *tls, int execute)
/* Get the index to the last cleaner function pushed onto the stack */

ndx = tls->tl_tos - 1;
DEBUGASSERT(ndx >= 0 && ndx < CONFIG_TLS_NCLEANUP);
DEBUGASSERT(ndx < CONFIG_TLS_NCLEANUP);

/* Should we execute the cleanup routine at the top of the stack? */

Expand Down

0 comments on commit 2c543c2

Please sign in to comment.