Skip to content

Commit

Permalink
plugins/porkbun: fix uninitiazlied variable
Browse files Browse the repository at this point in the history
I still don't understand what's going on in this function ...

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Aug 3, 2024
1 parent 0e2ca31 commit e1c196a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/porkbun.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ static int check_success_only(const char *json)
static int get_result_value(const char *json, const char *key, jsmntok_t *out_result)
{
jsmntok_t *tokens;
int i, num_tokens;
int num_tokens;
int i = 0;

This comment has been minimized.

Copy link
@BrainSlayer

BrainSlayer Aug 11, 2024

Contributor

i is used by check_success for no reason.
check_success(json, tokens + i + 1, num_tokens) should be replaced with
check_success(json, tokens + 1, num_tokens) since this was the reason for the warning


num_tokens = parse_json(json, &tokens);
if (num_tokens < 0)
Expand Down

0 comments on commit e1c196a

Please sign in to comment.