From: Rusty Russell Date: Tue, 10 Jun 2014 03:36:16 +0000 (+0930) Subject: crcsync: use tal/grab_file in _info example. X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=beb01ef8986c8957da74d3ca2a13d48a08277be6;p=ccan crcsync: use tal/grab_file in _info example. Signed-off-by: Rusty Russell --- diff --git a/ccan/crcsync/_info b/ccan/crcsync/_info index 3713c777..e6d51784 100644 --- a/ccan/crcsync/_info +++ b/ccan/crcsync/_info @@ -12,7 +12,8 @@ * // Calculate checksums of file (3-arg mode) * // Or print differences between file and checksums (4+ arg mode) * #include - * #include + * #include + * #include * #include * #include * #include @@ -37,10 +38,11 @@ * errx(1, "Usage: %s ...\n" * "OR: %s ", argv[0], argv[0]); * - * file = grab_file(NULL, argv[2], &len); + * file = grab_file(NULL, argv[2]); * if (!file) * err(1, "Opening file %s", argv[2]); - * + * len = tal_count(file) - 1; + * * if (argc == 3) { * // Short form prints CRCs of file for use in long form. * used = (len + blocksize - 1) / blocksize;