diff --git a/strbuf.h b/strbuf.h index 7b4b0784..5546aab0 100644 --- a/strbuf.h +++ b/strbuf.h @@ -88,7 +88,7 @@ struct strbuf { * * @author Andrew Bettison */ -#define STRUCT_STRBUF_EMPTY ((struct strbuf){NULL, (char *)NULL - 1, NULL}) +#define STRUCT_STRBUF_EMPTY ((struct strbuf){NULL, NULL, NULL}) typedef struct strbuf *strbuf; typedef const struct strbuf *const_strbuf; @@ -350,7 +350,7 @@ strbuf strbuf_trunc(strbuf sb, int offset); * @author Andrew Bettison */ __STRBUF_INLINE size_t strbuf_is_empty(const_strbuf sb) { - return sb->start == NULL && sb->end == sb->start - 1 && sb->current == NULL; + return sb->start == NULL && sb->end == NULL && sb->current == NULL; } diff --git a/testframework.sh b/testframework.sh index 2a282946..843f5cd5 100644 --- a/testframework.sh +++ b/testframework.sh @@ -175,7 +175,7 @@ runTests() { _tfw_echo_intro $testNumber $testName [ $njobs -ne 1 ] && echo ( - _tfw_unique=$BASHPID + _tfw_unique=$! echo "$testNumber $testName" >"$_tfw_results_dir/$_tfw_unique" _tfw_tmp=/tmp/_tfw-$_tfw_unique trap '_tfw_status=$?; rm -rf "$_tfw_tmp"; exit $_tfw_status' EXIT SIGHUP SIGINT SIGTERM