When swaynag is run with the -l/--detailed-message option, a crash may
occur if the detailed message read from stdin is large enough. E.g.:
swaynag -m hello -l < ~/.config/sway/config
The root cause is that the read_from_stdin() function under-allocates
memory for the destination buffer which causes that buffer to be overflowed
when copying line data to it with snprintf().
The repair is to allocate one more byte for the terminating null byte.
N.B. although getline() returns the number of bytes read excluding a
terminating null byte, the line buffer is terminated with a null byte. Thus
we have a guarantee that the line buffer will be null terminated (which is
important when copying with snprintf()).
In `i3 4.16`, `i3-nagbar` introduces the flags `-B/--button-no-terminal`
to run the action directly instead of inside a terminal. This implements
the flags for swaynag for compatibility.
Since swaynag does not use an equivalent to `i3-sensible-terminal`, the
flags `-b/--button` only uses a terminal when the environment variable
`TERMINAL` is set, otherwise it acts the same as these new flags.