Browse Source

str: change example to match function being explained.

Looks like the example was copy-n-pasted from the previous entry.
Brad Hards 15 years ago
parent
commit
737eacb13c
1 changed files with 4 additions and 2 deletions
  1. 4 2
      ccan/str/str.h

+ 4 - 2
ccan/str/str.h

@@ -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);