It's mostly wrappers for compatibility and another trivial stuff etc.
Let's keep it as public domain to make it more portable to LGPL, GPL
and BSD code.
Signed-off-by: Karel Zak <kzak@redhat.com>
CC: Sami Kerola <kerolasa@iki.fi>
CC: Ruediger Meier <ruediger.meier@ga-group.nl>
Marek reported there is a memory leak in lib/mangle.c
CC mangle.o
mangle.c:160:9: warning: Memory is never released; potential leak of memory pointed to by 'ss'
This patch fixes it.
Reported-by: Marek Otahal <markotahal@gmail.com>
Cc: Karel Zak <kzak@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Checking for the null byte at the end of the string only conditionally
leads to segfaults, evidenced by mount helpers crashing on writes to
/run/mount/utab. Simply check for the null on each iteration, and append
a null byte to the mangled string before breaking.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Solaris lacks err, errx, warn and warnx. This also means the err.h header
doesn't exist. Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
The old solution (without scanf()) was based on old code from
mount(8). It seems that the modern libc is able to provide all
necessary functionality by sscanf() and %ms directive.
Signed-off-by: Karel Zak <kzak@redhat.com>