Commit Graph

8 Commits

Author SHA1 Message Date
Eugene Syromyatnikov
3744bc73f7 Remove addflags
It has only single user and implementation of xlat styles for it would
lead to lots of code duplication.

* defs.h (addflags): Remove declaration.
* mem.c (print_mmap_flags): Convert addflags call into printflags64 with
non-zeroeness flags check.
* xlat.c (addflags): Remove.
2018-04-01 13:14:15 +00:00
daaf8ab7fe Update copyright headers
Headers updated automatically using maint/update_copyright_years.sh
script.
2018-02-13 22:00:00 +00:00
Eugene Syromyatnikov
0863915a0a xlat.c: return NULL in sprintflags if there are no flags
Otherwise the auxstr is rather ugly at times.

* xlat.c (sprintflags): Return NULL if no flags were printed.
2018-02-10 13:52:42 +00:00
Eugene Syromyatnikov
0b803f8edd Use xappendstr instead of xsnprintf where suitable
Replace occurrences of

    outptr += xsnprintf(outptr, sizeof(outstr) - (outptr - outstr), ...)

with much more sleek

    outptr = xappendstr(outstr, outptr, ...)

* desc.c (decode_select): Replace xsnprintf with xappendstr.
* open.c (sprint_open_modes): Likewise.
* poll.c (decode_poll_exiting): Likewise.
* signal.c (sprintsigmask_n): Likewise.
* xlat.c (sprintflags): Likewise.
2018-01-11 15:54:33 +00:00
Eugene Syromiatnikov
a907f4a126 xlat.c: add sprintxval for printing xval to string
* defs.h (sprintxval): New declaration.
(sprintxval): New function.
2018-01-07 00:05:42 +00:00
6e67a2b71e xlat.c: use xsnprintf instead of sprintf
* xlat.c: Include "xstring.h".
(sprintflags): Replace sprintf with xsnprintf.
2018-01-07 00:05:42 +00:00
184e94ba05 Fix a few spacing style issues
Reported by kernel's checkpatch.pl script.
2017-06-17 22:54:08 +00:00
88a34fa6da Move xlat related functions to a separate file
* util.c (xlookup, xlat_bsearch_compare, xlat_search, printxvals,
printxval_searchn, addflags, sprintflags, printflags_ex): Move ...
* xlat.c: ... to this new file.
* Makefile.am (strace_SOURCES): Add it.
2017-06-12 16:44:45 +00:00