diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-06-23 16:23:25 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-06-24 03:38:16 +0200 |
commit | 81a1270a56bf1f6a13e709e653598c69c7d9334b (patch) | |
tree | 7411ac19a1c40e3f68bf25697daaf2bb1a5ddc44 /src/interface.cpp | |
parent | 9e3913e8e9c25916911ef5e9f2a2d5b17e9e8c5c (diff) | |
download | sciteco-81a1270a56bf1f6a13e709e653598c69c7d9334b.tar.gz |
fixed SEGFAULTs in InterfaceCurses::vmsg()
* both vmsg() and stdio_msg() behave like vprintf() are allowed
to leave their `va_list` in an undefined state.
* therefore when writing messages to stdio in addition to the
message line, we have to copy the argument list.
* fixes SEGFAULTs when trying to log any message
(but this bug did not manifest on every test system)
Diffstat (limited to 'src/interface.cpp')
-rw-r--r-- | src/interface.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interface.cpp b/src/interface.cpp index 41cc93d..0bcdf28 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -107,6 +107,14 @@ Interface<InterfaceImpl, ViewImpl>::UndoTokenInfoUpdate<Type>::run(void) interface.info_update(obj); } +/** + * Print a message to the appropriate stdio streams. + * + * This method has similar semantics to `vprintf`, i.e. + * it leaves `ap` undefined. Therefore to pass the format + * string and arguments to another `vprintf`-like function, + * you have to copy the arguments via `va_copy`. + */ template <class InterfaceImpl, class ViewImpl> void Interface<InterfaceImpl, ViewImpl>::stdio_vmsg(MessageType type, const gchar *fmt, va_list ap) |