textual: fix some typos

Found with misspell-check version 2.0d.

Reference: https://github.com/lyda/misspell-check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
cal: remove unnused structure and definition

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: remove unnecessary variable

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lscpu: avoid use of bzero() in favor of memset()

The bzero() is marked as LEGACY in POSIX.1-2001.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
cfdisk: add braces to ensure operation order

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
fdformat: match variable and print format types

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
mkfs.cramfs: use defined failure name rather than magic value

From manual page; 'On error, the value MAP_FAILED is returned, and errno
is set appropriately'.

Reference: http://man7.org/linux/man-pages/man2/mmap.2.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
fdisk: avoid code duplication

To me having call to close() twice is less readable than one new
variable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
dmesg: avoid unnecessary variable assignment

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setpriv: avoid alloca() use xmalloc() instead

The getgroups() can return up to NGROUPS_MAX supplementary groups, that
is (since kernel 2.6.3) 65536 in total.  The git_t is 4 bytes, so maximum
request is 256 kilobytes.  When a system happen to have memory preasure
alloca() may not be able to allocate enough memory, making debugging
unnecessarily difficult.  IMHO 64 pages is significant enough amount of
memory to be properly error checked at a time of allocation.

Reference: http://www.gnu.org/software/libc/manual/html_node/Disadvantages-of-Alloca.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
whereis: avoid printing uninitialized string

The patbuf[] needs to be filled before print out.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
libfdisk: do not do the same thing twice in single if statement

The second argument was very likely meant to be 'be->offset'.
Maintainers review & sign-off will further verify this change being
correct.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
libsmartcols: avoid variable dereference after release

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lscpu: avoid double free

The double free was possible for architectures other than x86_64 or i386.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Merge branch 'minor-fixes' of git://github.com/kerolasa/lelux-utiliteetit

* 'minor-fixes' of git://github.com/kerolasa/lelux-utiliteetit:
  lscpu: avoid double free
  libsmartcols: avoid variable dereference after release
  libfdisk: do not do the same thing twice in single if statement
  whereis: avoid printing uninitialized string
  setpriv: avoid alloca() use xmalloc() instead
  dmesg: avoid unnecessary variable assignment
  fdisk: avoid code duplication
  mkfs.cramfs: use defined failure name rather than magic value
  fdformat: match variable and print format types
  cfdisk: add braces to ensure operation order
  lscpu: avoid use of bzero() in favor of memset()
  setterm: remove unnecessary variable
  cal: remove unnused structure and definition
  textual: fix some typos