-#include <string.h>
#include "config.h"
+#include <stdio.h>
+#include <string.h>
/**
* cast - routines for safer casting.
*
* Author: Jan Engelhardt
* Maintainer: Rusty Russell <rusty@rustcorp.com.au>
- * License: LGPL
+ * License: LGPL (v2.1 or any later version)
*
* Example:
- * // Given "test" contains "3 t's in 'test string'
+ * // Given "test" output contains "3 t's in 'test string'"
* #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)
* {
* 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",