util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsck.minix: remove unnecessary memset calls
@ 2011-11-08 22:14 Francesco Cosoleto
  2011-11-08 22:14 ` [PATCH] libblkid: silence a format string warning Francesco Cosoleto
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Francesco Cosoleto @ 2011-11-08 22:14 UTC (permalink / raw)
  To: util-linux; +Cc: Francesco Cosoleto

The program aborts without using this unintialized allocated memory,
setting to zero doesn't look needed.

memset calls with sizeof() of pointer as argument (reported by clang).

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
---
 disk-utils/fsck.minix.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/disk-utils/fsck.minix.c b/disk-utils/fsck.minix.c
index eb02f9e..90c9200 100644
--- a/disk-utils/fsck.minix.c
+++ b/disk-utils/fsck.minix.c
@@ -611,8 +611,6 @@ read_tables(void) {
 	zone_map = malloc(zmaps * MINIX_BLOCK_SIZE);
 	if (!inode_map)
 		die(_("Unable to allocate buffer for zone map"));
-	memset(inode_map,0,sizeof(inode_map));
-	memset(zone_map,0,sizeof(zone_map));
 	inode_buffer = malloc(buffsz);
 	if (!inode_buffer)
 		die(_("Unable to allocate buffer for inodes"));
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] libblkid: silence a format string warning
  2011-11-08 22:14 [PATCH] fsck.minix: remove unnecessary memset calls Francesco Cosoleto
@ 2011-11-08 22:14 ` Francesco Cosoleto
  2011-11-08 22:14 ` [PATCH] whereis: remove unused value warning Francesco Cosoleto
  2011-11-08 22:14 ` [PATCH] whereis: silence comparison between signed/unsigned warning Francesco Cosoleto
  2 siblings, 0 replies; 5+ messages in thread
From: Francesco Cosoleto @ 2011-11-08 22:14 UTC (permalink / raw)
  To: util-linux; +Cc: Francesco Cosoleto

Fix the following clang warning:

 exfat.c:130:41: warning: conversion specifies type 'unsigned short' but
 the argument has type 'uint8_t' (aka 'unsigned char') [-Wformat]
         blkid_probe_sprintf_version(pr, "%hu.%hu",
                                              ~~^
                                              %c

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
---
 libblkid/src/superblocks/exfat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c
index bada3a8..215c671 100644
--- a/libblkid/src/superblocks/exfat.c
+++ b/libblkid/src/superblocks/exfat.c
@@ -127,7 +127,7 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag)
 			sb->volume_serial[3], sb->volume_serial[2],
 			sb->volume_serial[1], sb->volume_serial[0]);
 
-	blkid_probe_sprintf_version(pr, "%hu.%hu",
+	blkid_probe_sprintf_version(pr, "%u.%u",
 			sb->version.major, sb->version.minor);
 
 	return 0;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] whereis: remove unused value warning
  2011-11-08 22:14 [PATCH] fsck.minix: remove unnecessary memset calls Francesco Cosoleto
  2011-11-08 22:14 ` [PATCH] libblkid: silence a format string warning Francesco Cosoleto
@ 2011-11-08 22:14 ` Francesco Cosoleto
  2011-11-08 22:14 ` [PATCH] whereis: silence comparison between signed/unsigned warning Francesco Cosoleto
  2 siblings, 0 replies; 5+ messages in thread
From: Francesco Cosoleto @ 2011-11-08 22:14 UTC (permalink / raw)
  To: util-linux; +Cc: Francesco Cosoleto

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
---
 misc-utils/whereis.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
index 9f74963..925cc93 100644
--- a/misc-utils/whereis.c
+++ b/misc-utils/whereis.c
@@ -268,7 +268,7 @@ static void fillpath(void)
 		return;
 	pathcp = xstrdup(path);
 
-	for (tmp = pathcp; ;tmp = NULL, tok) {
+	for (tmp = pathcp; ; tmp = NULL) {
 		tok = strtok_r(tmp, ":", &key);
 		if (!tok)
 			break;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] whereis: silence comparison between signed/unsigned warning
  2011-11-08 22:14 [PATCH] fsck.minix: remove unnecessary memset calls Francesco Cosoleto
  2011-11-08 22:14 ` [PATCH] libblkid: silence a format string warning Francesco Cosoleto
  2011-11-08 22:14 ` [PATCH] whereis: remove unused value warning Francesco Cosoleto
@ 2011-11-08 22:14 ` Francesco Cosoleto
  2011-11-09  9:07   ` Karel Zak
  2 siblings, 1 reply; 5+ messages in thread
From: Francesco Cosoleto @ 2011-11-08 22:14 UTC (permalink / raw)
  To: util-linux; +Cc: Francesco Cosoleto

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
---
 misc-utils/whereis.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
index 03ea95e..d776b32 100644
--- a/misc-utils/whereis.c
+++ b/misc-utils/whereis.c
@@ -241,7 +241,7 @@ findin(char *dir, char *cp)
 
 static int inpath(const char *str)
 {
-	int i;
+	size_t i;
 
 	for (i = 0; i < ARRAY_SIZE(bindirs) - 1 ; i++)
 		if (!strcmp(bindirs[i], str))
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] whereis: silence comparison between signed/unsigned warning
  2011-11-08 22:14 ` [PATCH] whereis: silence comparison between signed/unsigned warning Francesco Cosoleto
@ 2011-11-09  9:07   ` Karel Zak
  0 siblings, 0 replies; 5+ messages in thread
From: Karel Zak @ 2011-11-09  9:07 UTC (permalink / raw)
  To: Francesco Cosoleto; +Cc: util-linux


 All your patches applied, except this one.

On Tue, Nov 08, 2011 at 11:14:55PM +0100, Francesco Cosoleto wrote:

> Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
> ---
>  misc-utils/whereis.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
> index 03ea95e..d776b32 100644
> --- a/misc-utils/whereis.c
> +++ b/misc-utils/whereis.c
> @@ -241,7 +241,7 @@ findin(char *dir, char *cp)
>  
>  static int inpath(const char *str)
>  {
> -	int i;
> +	size_t i;

 It seems that your git tree is not up to date, this problem has been
 already fixed:

 $ git blame -L244,+1 misc-utils/whereis.c
 cc69f339 (Karel Zak 2011-08-31 11:58:01 +0200 244)      size_t i;

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-09  9:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 22:14 [PATCH] fsck.minix: remove unnecessary memset calls Francesco Cosoleto
2011-11-08 22:14 ` [PATCH] libblkid: silence a format string warning Francesco Cosoleto
2011-11-08 22:14 ` [PATCH] whereis: remove unused value warning Francesco Cosoleto
2011-11-08 22:14 ` [PATCH] whereis: silence comparison between signed/unsigned warning Francesco Cosoleto
2011-11-09  9:07   ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).