string.c: Don't fall back to /tmp in para_homedir(). This can only lead to trouble. If we can't get the path to the home directory, something is deeply wrong and we really should abort.
create_argv_offset(): Use arr_zalloc(). There is no point in initializing the allocated array manually, and it does not hurt to initialize also the last element.
Open-code find_arg(). There is only one caller in client_common.c, so open-code the logic there and get rid of the public function and the unused error code.
Merge topic branch t/overflow into master This series implements a new memory allocation API which checks for overflows. The first part of the series just renames the main allocation functions. Later patches in the series implement allocators which take two size_t arguments (like calloc(3)) and check whether the multiplication overflows by employing the __builtin_mul_overflow() primitive supported by gcc and clang. This requires us to bump the lowest supported gcc and clang version. * refs/heads/t/overflow: build: Compile with -ftrapv. string: Introduce arr_zalloc(). string: Introduce arr_alloc(). string: Introduce arr_realloc() and check for integer overflow. string: Rename para_calloc() -> zalloc(). string: Rename para_malloc() -> alloc(). string: Overhaul para_strdup().
Merge branch 'refs/heads/t/ll' Two little cleanups related to the logging facility and two commits which add the ll command to para_server and para_audiod. The merge resulted in a conflict in afs.c due to the earlier merge of the poll topic branch which replaced all calls to select() by calls to poll(). The implementation of the ll server command introduced a new caller of select(), afs_select(), which needs to be replaced by afs_poll() to resolve the conflict. * refs/heads/t/ll: New server command: ll to change the log level at runtime. New audiod command: ll to change the log level at runtime. daemon: Kill get_loglevel_by_name(). server/audiod: Don't parse loglevel argument unnecessarily.
string: Introduce arr_zalloc(). Adjust all callers which pass a product of two integers to zalloc() to call the new function instead and reduce zalloc() to a one-line wrapper.
string: Introduce arr_alloc(). Change all callers of alloc() which pass a product of two integers as the allocation size to call the new function instead. This function aborts if the multiplication overflows. With arr_alloc() in place, alloc() reduces to a trivial wrapper which calls new arr_alloc() with the first argument equal to one.
string: Introduce arr_realloc() and check for integer overflow. Use __builtin_mul_overflow() for the check. This builtin was introduced in gcc-5, so we need to bump the lowest supported version. Re-implement para_realloc() as a trivial wrapper for arr_realloc() to simplify and to avoid duplicating the size check.
string: Rename para_calloc() -> zalloc(). Reword the documentation a bit since the function has never been a wrapper for calloc(3). No code changes.
string: Rename para_malloc() -> alloc(). Just because it's shorter and matches the naming of the new allocators we are about to introduce. The bulk of this patch was created with sed -i 's/para_malloc/alloc/g' *.c *.h yy/mp.y
string: Overhaul para_strdup(). We don't need to print an error message because it will be clear what has happened when the assertion triggers. Reword the documentation and mention that the memory allocated by this function must be freed by the caller.
daemon: Kill get_loglevel_by_name(). Open-code the logic in daemon_set_log_color_or_die() and get the values from the new SEVERTIES macro rather than duplicating the severity list in get_loglevel_by_name(). The SEVERTIES macro will turn out to be handy for the ll subcommands of para_server and para_audiod which are introduced in subsequent commits.
Remove para_dirname() and para_basename(). The former has only a single caller, the second only two, open-coding these is actually simpler and more performant because we no longer scan each path twice and avoid the temporary copy of the path.
Simplify and improve freep(). Make it a no-op if NULL is passed. Also the comment to \param was slightly incorrect and the code contained an unnecessary cast.
string.c: Fix typos in comment.
Shorten copyright notice. The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
Merge branch 'refs/heads/t/doxygen' This series contains an update of Doxyfile to a newer doxygen version and an overhaul of the source code documentation. Several stale references have been fixed. Other parts of the documentation have been improved. Cooking for almost a month. * refs/heads/t/doxygen: aft.c: Trivial spelling/whitespace fixes. afh: Expand documentation of init function declarations. filter: Remove duplicate documentation of filter_get(). doxygen: Improve documentation of struct receiver. doxygen: Add \ref to references. Improve documentation of mm.c and mm.h. doxygen: Don't refer to Black Hats Manual. doxygen: Don't refer to libosl functions. doxygen: Trivial cleanups. doxygen: Remove some stale doxygen references. recv: Explain user data mechanism. Update to doxygen-1.8.11. The merge resulted in a few conflicts which were easy to resolve.
Remove some unnecessary includes. These headers are already included with para.h.
doxygen: Add \ref to references. This way doxygen issues a warning if the file/function/structure no longer exists and a stale reference remains.
doxygen: Trivial cleanups. A couple of capitalization and punctuation fixes.