]> git.ozlabs.org Git - ccan/commitdiff
str: change example to match function being explained.
authorBrad Hards <bradh@frogmouth.net>
Sun, 16 Jan 2011 05:22:46 +0000 (16:22 +1100)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 17 Jan 2011 05:53:26 +0000 (16:23 +1030)
Looks like the example was copy-n-pasted from the previous entry.

ccan/str/str.h

index 770a40fd1f4dca3fe599cfdee109fe9fa581b861..bf858f13b69cb1f671a895450004f36a6ad361cd 100644 (file)
@@ -62,8 +62,10 @@ static inline bool strends(const char *str, const char *postfix)
  * @needle: a substring
  *
  * Example:
- *     #define PRINT_COND_IF_FALSE(cond) \
- *             ((cond) || printf("%s is false!", stringify(cond)))
+ *     int i;
+ *      i = strcount("aaa aaa", "a");  // i = 6;
+ *      i = strcount("aaa aaa", "ab"); // i = 0;
+ *      i = strcount("aaa aaa", "aa"); // i = 2;
  */
 size_t strcount(const char *haystack, const char *needle);