Fix building and testing on OSX

This commit is contained in:
Jeremy Lakeman 2012-07-13 12:30:59 +09:30
parent 0255d7938e
commit 7fb1fd7938
2 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ struct strbuf {
*
* @author Andrew Bettison <andrew@servalproject.com>
*/
#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 <andrew@servalproject.com>
*/
__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;
}

View File

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