mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
json_tok_len, json_tok_contents: rename to json_tok_full_len and json_tok_full
These are only supposed to be used when you want the token contents including surrounding "". We should use this when reporting errors, but usually we just want to access the tok members directly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -363,7 +363,7 @@ int main(int argc, char *argv[])
|
||||
if (!json_tok_streq(resp, id, idstr))
|
||||
errx(ERROR_TALKING_TO_LIGHTNINGD,
|
||||
"Incorrect 'id' in response: %.*s",
|
||||
json_tok_len(id), json_tok_contents(resp, id));
|
||||
json_tok_full_len(id), json_tok_full(resp, id));
|
||||
|
||||
if (!error || json_tok_is_null(resp, error)) {
|
||||
// if we have specific help command
|
||||
@@ -374,8 +374,8 @@ int main(int argc, char *argv[])
|
||||
human_readable(resp, result, '\n');
|
||||
else
|
||||
printf("%.*s\n",
|
||||
json_tok_len(result),
|
||||
json_tok_contents(resp, result));
|
||||
json_tok_full_len(result),
|
||||
json_tok_full(resp, result));
|
||||
tal_free(lightning_dir);
|
||||
tal_free(rpc_filename);
|
||||
tal_free(ctx);
|
||||
@@ -384,7 +384,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
printf("%.*s\n",
|
||||
json_tok_len(error), json_tok_contents(resp, error));
|
||||
json_tok_full_len(error), json_tok_full(resp, error));
|
||||
tal_free(lightning_dir);
|
||||
tal_free(rpc_filename);
|
||||
tal_free(ctx);
|
||||
|
||||
Reference in New Issue
Block a user