Skip to content

Commit

Permalink
Merge pull request #273 from cheese/master
Browse files Browse the repository at this point in the history
Fix crashing of tests when '-Wp,-D_GLIBCXX_ASSERTIONS' is given
  • Loading branch information
SpamapS authored Feb 18, 2020
2 parents 354e06c + d6507e5 commit a6bd168
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libtest/cmdline.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class Application {

const char* stdout_c_str() const
{
return &_stdout_buffer[0];
return _stdout_buffer.size() ? &_stdout_buffer[0] : NULL;
}

libtest::vchar_t stderr_result() const
Expand All @@ -163,7 +163,7 @@ class Application {

const char* stderr_c_str() const
{
return &_stderr_buffer[0];
return _stderr_buffer.size() ? &_stderr_buffer[0] : NULL;
}

size_t stderr_result_length() const
Expand Down
2 changes: 1 addition & 1 deletion tests/hostile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ extern "C" {
gearman_return_t rc;
void *value= gearman_client_do(&client, WORKER_FUNCTION_NAME,
NULL,
&payload[0],
payload.size() ? &payload[0] : NULL,
payload.size() ? random() % payload.size() : 0,
NULL, &rc);

Expand Down

0 comments on commit a6bd168

Please sign in to comment.