Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ccan/opt: fix comparison with different signedness #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ccan/opt/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static void show_llong_with_suffix(char *buf, size_t len, long long ll,
const long long base)
{
const char *suffixes = "kMGTPE";
int i;
size_t i;
if (ll == 0){
/*zero is special because everything divides it (you'd get "0E")*/
snprintf(buf, len, "0");
Expand All @@ -484,7 +484,7 @@ static void show_ullong_with_suffix(char *buf, size_t len,
const unsigned base)
{
const char *suffixes = "kMGTPE";
int i;
size_t i;
if (ull == 0){
/*zero is special because everything divides it (you'd get "0E")*/
snprintf(buf, len, "0");
Expand Down
3 changes: 2 additions & 1 deletion ccan/opt/opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ void _opt_register(const char *names, enum opt_type type,

bool opt_unregister(const char *names)
{
int found = -1, i;
int found = -1;
unsigned int i;

for (i = 0; i < opt_count; i++) {
if (opt_table[i].type & OPT_SUBTABLE)
Expand Down