]> git.ozlabs.org Git - ccan/blobdiff - ccan/tal/str/_info
cast, str, take, tal/grabfile, tal/str, typesafe_cb: use argc
[ccan] / ccan / tal / str / _info
index 381dd98b1d1aa6d01a8f02ef2e54382081c4fb5f..3037cfde2fba99fcf1e817c0117ed8b89909fee3 100644 (file)
@@ -1,6 +1,6 @@
+#include "config.h"
 #include <stdio.h>
 #include <string.h>
-#include "config.h"
 
 /**
  * tal/str - string helper routines which use tal
@@ -11,7 +11,7 @@
  *
  * Example:
  *     #include <ccan/tal/str/str.h>
- *     #include <ccan/grab_file/grab_file.h>
+ *     #include <ccan/tal/grab_file/grab_file.h>
  *     #include <err.h>
  *
  *     // Dumb demo program to double-linespace a file.
  *             char *textfile;
  *             char **lines;
  *
+ *             if (argc > 2)
+ *                     errx(1, "Takes 0 or 1 arguments");
  *             // Grab lines in file.
- *             textfile = grab_file(NULL, argv[1], NULL);
+ *             textfile = grab_file(NULL, argv[1]);
  *             if (!textfile)
  *                     err(1, "Failed reading %s", argv[1]);
  *             lines = tal_strsplit(textfile, textfile, "\n", STR_EMPTY_OK);