bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix the ``--priority'' option handling in netfs_append_args.


From: Sergiu Ivanov
Subject: [PATCH] Fix the ``--priority'' option handling in netfs_append_args.
Date: Tue, 11 Aug 2009 00:03:59 +0300
User-agent: Mutt/1.5.18 (2008-05-17)

>From 95210c2ff4daa226eea7127dc2878995d989abaf Mon Sep 17 00:00:00 2001
From: Sergiu Ivanov <unlimitedscolobb@gmail.com>
Date: Mon, 10 Aug 2009 20:54:03 +0000
Subject: [PATCH] Fix the ``--priority'' option handling in netfs_append_args.

* netfs.c (netfs_append_args): Change the format specification
to ``%d''.
---

I've been looking at this gcc warning for about a year, but I though
it was some secret plan of the creator of unionfs, until I ran into
some memory corruption due to this bug.

---
 netfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/netfs.c b/netfs.c
index b3174fb..bb89c95 100644
--- a/netfs.c
+++ b/netfs.c
@@ -60,7 +60,7 @@ netfs_append_args (char **argz, size_t *argz_len)
        if (ulfs->priority)
          {
            char *buf = NULL;
-           if ((err = asprintf (&buf, "%s=%s", OPT_LONG (OPT_LONG_PRIORITY), 
+           if ((err = asprintf (&buf, "%s=%d", OPT_LONG (OPT_LONG_PRIORITY),
                      ulfs->priority)) != -1)
              {
                err = argz_add (argz, argz_len, buf);
-- 
1.6.3.3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]