]> git.ozlabs.org Git - ccan/blobdiff - ccan/cast/_info
cast, str, take, tal/grabfile, tal/str, typesafe_cb: use argc
[ccan] / ccan / cast / _info
index b09e0344e49d6ee570e9b70dbbe98e75393d8847..29128b8d5cf7cff915b07fa01783c2c44727073f 100644 (file)
@@ -24,6 +24,7 @@
  *     #include <ccan/cast/cast.h>
  *     #include <stdint.h>
  *     #include <stdio.h>
  *     #include <ccan/cast/cast.h>
  *     #include <stdint.h>
  *     #include <stdio.h>
+ *     #include <stdlib.h>
  *
  *     // Find char @orig in @str, if @repl, replace them.  Return number.
  *     static size_t find_chars(char *str, char orig, char repl)
  *
  *     // Find char @orig in @str, if @repl, replace them.  Return number.
  *     static size_t find_chars(char *str, char orig, char repl)
@@ -53,6 +54,9 @@
  *     {
  *             uint64_t hash;
  *
  *     {
  *             uint64_t hash;
  *
+ *             if (argc != 2) {
+ *                     fprintf(stderr, "Needs argument\n"); exit(1);
+ *             }
  *             // find_chars wants a non-const string, but doesn't
  *             // need it if repl == 0.
  *             printf("%zu %c's in 'test string'\n",
  *             // find_chars wants a non-const string, but doesn't
  *             // need it if repl == 0.
  *             printf("%zu %c's in 'test string'\n",