.. due to libsmartcols use for the default output. The output does not
contain extra unnecessary blank space anymore.
Signed-off-by: Karel Zak <kzak@redhat.com>
Adding _FUNCTION_DEF definition will exclude compatibility type definitions
that do include void key word in empty argument list.
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function
declaration of function 'Function'
These functions has been replaced by set of new ones in readline 4.2 (April
2001), and removed in 6.3 (February 2014).
Reference: https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES
Rererence: https://blueslugs.com/blog/2016-10-23-updating-cppfunction-in-old-readline-consumers/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Without obvious reason blkid has managed to be part of this project for
pretty long time without getting translations. Lets change that. In same
go use the usual error printing facilities instead of fprintf(stderr, ...);
[kzak@redhat.com: - use errtryh(),
- cleanup "unsupported output format"]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Some say people read do-while statements are easily as while statements and
get wrong impression. This happens because do-whiles are not common.
Adding braces should make it easier to read the code.
Reference: http://www.spinics.net/lists/linux-kernel-janitors/msg02018.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Make usage() translations to contain complete option help in single
translation unit. And make -z option example complete.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
./include/optutils.h:12:18: warning: null pointer dereference [-Wnull-dereference]
for (o = opts; o->name; o++)
~^~~~~~
In file included from libfdisk/src/dos.c:12:0:
./include/pt-mbr.h:25:47: warning: potential null pointer dereference [-Wnull-dereference]
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
~^~~
Well these should be impossible, so add assert() to catch possible bugs.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Following condition can be true if minix file system is corrupt, and versio
number is found to be greater than 3. It is fair to say described scenario
is unlikely.
libblkid/src/superblocks/minix.c:107:13: warning: variable 'zone_size' is
used uninitialized whenever
'if' condition is false [-Wsometimes-uninitialized]
} else if (version == 3) {
^~~~~~~~~~~~
libblkid/src/superblocks/minix.c:121:6: note: uninitialized use occurs here
if (zone_size != 0 || ninodes == 0 || ninodes == UINT32_MAX)
^~~~~~~~~
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
libblkid/src/superblocks/drbdmanage.c:38:42: warning: too long
initializer-string for array of char(no space for nul char)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/colors.c: In function 'colors_read_schemes':
lib/colors.c:412:7: warning: potential null pointer dereference [-Wnull-dereference]
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Use xstrcpy() to explicitly terminate the domain string.
Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
If the file /etc/hushlogins exists and a line starts with '\0', the
login tools are prone to an off-by-one read.
I see no reliability issue with this, as it would clearly need a
hostile action from a system administrator. But for the sake of
correctness, I've sent this patch nonetheless.
The SEND_UEVENT=yes|no line is not properly parsed, because the offset
jumps one byte too far behind the equal sign. Therefore, every
configuration that contains the line "SEND_UEVENT=yes" still does not
send an uevent.
The fix is simple: adjust the offset to be "12" instead of "13".
* hwclock.c: replace interpret_date_string() with parse_date().
Eliminates shell injection vulnerability from popen() date(1).
Removes system dependency on date(1).
Reduction in hwclock execution time.
Significant cleanup of hwclock.c code.
* Bug fix for "hwclock --predict --date 'bad_date'" printing:
hwclock: No usable set-to time. Cannot set clock.
The message now matches date(1) for an invalid --date argument.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
* add lib/parse-date.y to build system
* add necessary autotools stuff to generate .c on the fly
(autotools are smart enough to add generated file to tarball)
* check for bison version by ./autogen.sh
* add non-wanted junk to .gitignore
With some modification by J William Piggott with regard to
moving the parse-date API into timeutils.h
Signed-off-by: J William Piggott <elseifthen@gmx.com>
* include/timeutils.h
Add parse-date API
* lib/parse-date.y - new file
Lib function that parses a date string into a timespec struct.
Derived from gnulib-dd7a871 parse-datetime.y with these changes:
* reduced to a single function API renamed to parse_date()
* removed gnulib dependencies
* removed debugging
* converted to util-linux coding style
* include/cctype.h - new file
Like ctype.h only hard coded to the 'C' locale.
Used by lib/parse-date.y.
Derived from gnulib-dd7a871 c-ctype.h with these changes:
* removed gnulib dependencies
* converted to util-linux coding style
* add requisite util-linux constants
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Now it's impossible to add new column if the table already contains
lines with data. This patch forces library to realloc cell array in
the lines to accept a new column.
Signed-off-by: Karel Zak <kzak@redhat.com>
The man page contains mistakes. The default is to fill columns before
lines:
$ printf 'aaaaaaaaaaaaaaaaaaaaaa\nBBBBBBBBBBBBBBBBBBBBB\nXXXXXXX\nYYYYYYYYYYY\nZZZZZ' > data
$ column --columns 80 < data
aaaaaaaaaaaaaaaaaaaaaa XXXXXXX ZZZZZ
BBBBBBBBBBBBBBBBBBBBB YYYYYYYYYYY
$ column --fillrows --columns 80 < data
aaaaaaaaaaaaaaaaaaaaaa BBBBBBBBBBBBBBBBBBBBB XXXXXXX
YYYYYYYYYYY ZZZZZ
The patch also rename functions in the code to make it more obvious
for code readers.
Signed-off-by: Karel Zak <kzak@redhat.com>
The length option is used to specify the number of zones to
operate on. To be more consistent with other tools, have this
option use a number of sectors and introduce the --count option
to allow users to specify a number of zones.
The --count and --length options cannot be used together on
the command line.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Add "0x" to the zone start, length and write pointer print
to make it always clear that the values are Hexadecimal.
Also update the zone condition string and associated comments
to match more closely the wording in the standard document.
The man page is also updated to match the new wording.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Report all zones of the block device when length is not specified
on the command line. To do this, introduce an inner loop in
blkzone_report to repeatedly issue report zone ioctl to the
device.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
If length is 0, operate on all zones starting from offset.
This also fix the maximum length calculation from offset.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Let's follow only $enable_ variables. In this case the MASTERNAME
(e.g. [schedutils] for --enable-schedutils) has to be without
UL_BUILD_INIT.
Signed-off-by: Karel Zak <kzak@redhat.com>