summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorKarel Zak2014-07-14 16:03:48 +0200
committerKarel Zak2014-07-14 16:03:48 +0200
commit2fa32bea49992d5adeac2a37a42e97241ee73439 (patch)
treea7df10e2df79e267e51cc858d091cf37a5524018 /misc-utils
parentuuidd.rc: Requires remote_fs (diff)
parentlscpu: avoid double free (diff)
downloadkernel-qcow2-util-linux-2fa32bea49992d5adeac2a37a42e97241ee73439.tar.gz
kernel-qcow2-util-linux-2fa32bea49992d5adeac2a37a42e97241ee73439.tar.xz
kernel-qcow2-util-linux-2fa32bea49992d5adeac2a37a42e97241ee73439.zip
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
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/cal.c5
-rw-r--r--misc-utils/whereis.c3
2 files changed, 1 insertions, 7 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 100426639..a11136a5b 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -187,12 +187,7 @@ enum {
#define TODAY_FLAG 0x400 /* flag day for highlighting */
-#define FMT_ST_LINES 9
#define FMT_ST_CHARS 300 /* 90 suffices in most locales */
-struct fmt_st
-{
- char s[FMT_ST_LINES][FMT_ST_CHARS];
-};
static const int days_in_month[2][13] = {
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
index dc7406b94..62730328c 100644
--- a/misc-utils/whereis.c
+++ b/misc-utils/whereis.c
@@ -408,13 +408,12 @@ static void lookup(const char *pattern, struct wh_dirlist *ls, int want)
int count = 0;
char *wait = NULL, *p;
- DBG(printf("lookup dirs for '%s' (%s)", patbuf, pattern));
-
/* canonicalize pattern -- remove path suffix etc. */
p = strrchr(pattern, '/');
p = p ? p + 1 : (char *) pattern;
strncpy(patbuf, p, PATH_MAX);
patbuf[PATH_MAX - 1] = '\0';
+ DBG(printf("lookup dirs for '%s' (%s)", patbuf, pattern));
p = strrchr(patbuf, '.');
if (p)
*p = '\0';