mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
devtools/onion: allow '-' input file so you can pipe from stdin.
This avoid the requirement to use a temporary file. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
2b2ee87801
commit
43a46e252c
@@ -145,7 +145,8 @@ static void do_decode(int argc, char **argv, const u8 assocdata[ASSOC_DATA_SIZE]
|
|||||||
if (argc != 4)
|
if (argc != 4)
|
||||||
opt_usage_exit_fail("Expect an filename and privkey with 'decode' method");
|
opt_usage_exit_fail("Expect an filename and privkey with 'decode' method");
|
||||||
|
|
||||||
char *hextemp = grab_file(ctx, argv[2]);
|
/* "-" means stdin, which is NULL for grab_file */
|
||||||
|
char *hextemp = grab_file(ctx, streq(argv[2], "-") ? NULL : argv[2]);
|
||||||
size_t hexlen = strlen(hextemp);
|
size_t hexlen = strlen(hextemp);
|
||||||
|
|
||||||
// trim trailing whitespace
|
// trim trailing whitespace
|
||||||
|
|||||||
Reference in New Issue
Block a user