Commit Graph

2 Commits

Author SHA1 Message Date
Eugene Syromyatnikov
fdec47f63f xstring.h: add xappendstr
Introduce a macro for handling common case of partial writes
to a character array.

* xstring.h (get_pos_diff_): New function.
(xappendstr): New macro.
2018-01-11 15:54:33 +00:00
Eugene Syromyatnikov
0b92a3c933 Introduce hardened xsprintf/xsnprintf macros
Let's try to future/fool-proof code a bit by introducing variants
of sprintf/snprintf that die if an overflow (or an error) occurs.
They are deemed to be the default choice for printing to some local
string buffer where no sensible error handling is implemented.

* xstring.h: New file.
* Makefile.am (strace_SOURCES): Add it.
2018-01-05 12:26:47 +00:00