5 Commits

Author SHA1 Message Date
d6c71dd061 Fix preprocessor indentation
Indent the C preprocessor directives to reflect their nesting
using the following script:

$ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do
	cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
done
2018-12-30 15:35:21 +00:00
92e347b556 Add copyright headers to some files that lack them
We do our best to keep copyright headers up to date, yet
git history provides better information on this subject
and is more accurate than copyright headers.
2018-12-24 23:46:43 +00:00
Eugene Syromyatnikov
04b836f024 xstring.h: rephrase xappendstr description a bit 2018-02-10 13:52:42 +00:00
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