Skip to content

Commit

Permalink
Remove CodeQL warnings
Browse files Browse the repository at this point in the history
Changes made according to the latest version of zxlib.
  • Loading branch information
relatko committed Jan 4, 2024
1 parent 45b3c7b commit 1c872ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions deps/ledger-zxlib/app/ui/view_nano_inspect.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ void view_inspect_init(viewfunc_getInnerItem_t view_funcGetInnerItem,
}

bool h_paging_inspect_go_to_root_screen() {
return (viewdata.innerField.level >= 0) &&
(viewdata.innerField.paging.itemIdx == 0)
return (viewdata.innerField.paging.itemIdx == 0)
&& (viewdata.innerField.trace[0] != 0);
}

bool h_paging_inspect_back_screen() {
return (viewdata.innerField.level >= 0) &&
(viewdata.innerField.paging.itemIdx == (viewdata.innerField.paging.itemCount - 1))
return (viewdata.innerField.paging.itemIdx == (viewdata.innerField.paging.itemCount - 1))
&& (viewdata.innerField.trace[0] != 0);
}

Expand Down
4 changes: 2 additions & 2 deletions deps/ledger-zxlib/include/utf8.h
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ utf8_int8_t *c = utf8_null;
size_t bytes = 0;

/* Find the end of the string or stop when n is reached */
while ('\0' != src[bytes] && bytes < n) {
while (bytes < n && '\0' != src[bytes]) {
bytes++;
}

Expand All @@ -722,7 +722,7 @@ return utf8_null;
bytes = 0;

/* copy src byte-by-byte into our new utf8 string */
while ('\0' != src[bytes] && bytes < n) {
while (bytes < n && '\0' != src[bytes]) {
c[bytes] = src[bytes];
bytes++;
}
Expand Down

0 comments on commit 1c872ea

Please sign in to comment.