- 17 Mar, 2011 8 commits
-
-
Rusty Russell authored
The standard ctype.h variants will make you go insane if you contemplate them for too long.
-
Rusty Russell authored
isspace() and isdigit() want an unsigned value.
-
Rusty Russell authored
tolower(), toupper() and isupper want an unsigned value. Also, fix lazy cost-discarding inside strrchr for extra safety.
-
Rusty Russell authored
If we detect any mention of a problematic string function, try compiling the entire module with string debugging enabled.
-
Rusty Russell authored
In the former case, we were bitten by the fact that you don't pass a char to isalpha() et al: you pass an int. This means on most platforms you want to do: if (isalpha((unsigned char)c)) ... Insane? Yes, but I assure you I'm not making this up. Similarly, I've always wanted strstr, strchr and strrchr to return const char * when given a const char * argument to search, to avoid constness leak. In both cases, the actual versions from the headers may be macros, so we need to be very careful overriding them. The result is that they become out-of-line functions which is unacceptable for general performance. So we only activate these when CCAN_STR_DEBUG is defined.
-
Rusty Russell authored
Same thing (a BUILD_ASSERT which evaluates to zero), but there's a strong preference for all modules to stick with their own names as prefixes.
-
Rusty Russell authored
They're often out-of-date, and we're about to do special things to the str module compile flags, so we don't *ever* want the default. It doesn't add much to build times, and it eliminates a nasty source of weird errors.
-
Rusty Russell authored
We need to flush stdout before forking.
-
- 16 Mar, 2011 9 commits
-
-
Brad Hards authored
Also add a note about a possible segfault.
-
Rusty Russell authored
We don't use it for the moment, but Brad Hards noted that assigning to dest ten continuing was pointless, revealing this bug.
-
Brad Hards authored
We only ever write to this variable, so can just be removed.
-
Brad Hards authored
This is always overwritten later in the function.
-
Brad Hards authored
obe is always overwritten later.
-
Brad Hards authored
-
Brad Hards authored
-
Brad Hards authored
last is unconditionally set to zero later in this function.
-
Brad Hards authored
lp_bits was only ever written to.
-
- 01 Mar, 2011 1 commit
-
-
Rusty Russell authored
asprintf is a PITA to use, and it's not in POSIX anyway. Provide replacements, and also provide a nicer-to-use afmt() wrapper.
-
- 08 Mar, 2011 2 commits
-
-
Joey Adams authored
tools/ccan_depends --compile ccan/module (without a trailing slash) results in a segfault.
-
Joey Adams authored
(Patched forward by Rusty)
-
- 07 Mar, 2011 2 commits
-
-
Andreas Schlick authored
-
Andreas Schlick authored
-
- 02 Mar, 2011 4 commits
-
-
Rusty Russell authored
-
Rusty Russell authored
We get a point for every run or api test, rather than 1 point for all of them, so be consistent.
-
Rusty Russell authored
cast package has all negative tests, plus testable examples.
-
Rusty Russell authored
Thanks to Andreas Schlick, we have a nicer test for when gcc warns about trampolines (gcc 4.6's -Wtrampolines). This works at any optimization level, and means when that warning is enabled we recognize that we shouldn't allow nested functions.
-
- 01 Mar, 2011 14 commits
-
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
Increase from: 1985 of 2553 lines covered to: 2020 of 2552 lines covered
-
Rusty Russell authored
Increase from: 1985 of 2553 lines covered to: 2018 of 2552 lines covered
-
Rusty Russell authored
Increase from: 1962 of 2553 lines covered to: 1985 of 2553 lines covered
-
Rusty Russell authored
The "ret < n" was done as an unsigned comparison, so it didn't work as expected when ret was negative. Simplest fix is to do an equals comparison everywhere, which is also slightly stricter.
-
Rusty Russell authored
You can always specify the TDB_NOLOCK flag along with O_RDONLY for the old behaviour.
-
Rusty Russell authored
If benchmarking indicates a problem later, we can restore it.
-
Rusty Russell authored
Mostly a fairly simple transformation, since 0 still means success. One new twist is that tdb_nextkey now frees the .dptr of the key; this us usually what we want but does cause issues for our weird test code.
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
Of course, we leave the API the same, but percolate error codes all the way back to tdb_check().
-
Rusty Russell authored
In particular, tdb_needs_recovery() can now indicate an error occurred, rather than returning true.
-
Rusty Russell authored
-