Skip to content

Commit

Permalink
daemon/json, test/test_protocol: avoid gcc -O warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Dec 15, 2016
1 parent e109977 commit a44e4fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion daemon/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ bool json_get_params(const char *buffer, const jsmntok_t param[], ...)
{
va_list ap;
const char *name;
const jsmntok_t **tokptr, *p, *end;
/* Uninitialized warnings on p and end */
const jsmntok_t **tokptr, *p = NULL, *end = NULL;

if (param->type == JSMN_ARRAY) {
if (param->size == 0)
Expand Down
4 changes: 3 additions & 1 deletion test/test_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,9 @@ static void do_cmd(struct peer *peer)
} else
errx(1, "%s: Unknown command %s", peer->name, cmd);

write(peer->cmddonefd, peer->info, strlen(peer->info)+1);
if (write(peer->cmddonefd, peer->info, strlen(peer->info)+1)
!= strlen(peer->info)+1)
abort();

/* We must always have (at least one) signed, unrevoked commit. */
for (ci = peer->local; ci; ci = ci->prev) {
Expand Down

0 comments on commit a44e4fb

Please sign in to comment.