Skip to content

Commit

Permalink
sendmail: Fix compile error with GCC older than 4.9
Browse files Browse the repository at this point in the history
cli_main contains a variable-length array that is initialized to the
constant {0}. This extension to the C++ standard is not present in older
versions of GCC, so replace it here with a memset.

Fixes #51
  • Loading branch information
bruceg committed Jan 17, 2018
1 parent 900e164 commit 8f12d16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
This file lists all the major user-visible changes to nullmailer.

- Fixed compile error in sendmail on GCC older than 4.9.
-------------------------------------------------------------------------------
Changes in version 2.1

Expand Down
3 changes: 2 additions & 1 deletion src/sendmail.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ int do_exec(const char* program, const char* args[])

int cli_main(int argc, char* argv[])
{
const char* extra_args[argc + 5] = {0};
const char* extra_args[argc + 5];
int extra_argc = 1;
memset(extra_args, 0, sizeof extra_args);

switch (o_mode) {
case mode_smtp:
Expand Down

0 comments on commit 8f12d16

Please sign in to comment.