WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-4.0-testing] bitmap_scnlistprintf() should always z

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] bitmap_scnlistprintf() should always zero-terminate its output buffer
From: Xen patchbot-4.0-testing <patchbot@xxxxxxx>
Date: Tue, 13 Sep 2011 12:22:13 +0100
Delivery-date: Tue, 13 Sep 2011 04:22:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1315906927 -3600
# Node ID 487d9e6505847c195aa38b637a80a4c39523691c
# Parent  95f9d131207322f3e3373a55a3e22ece8c24493a
bitmap_scnlistprintf() should always zero-terminate its output buffer

... as long as it has non-zero size. So far this would not happen if
the passed in CPU mask was empty.

Also fix the comment describing the return value to actually match
reality.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
xen-unstable changeset:   23820:ba75234a6f56
xen-unstable date:        Wed Sep 07 10:36:55 2011 +0100
---


diff -r 95f9d1312073 -r 487d9e650584 xen/common/bitmap.c
--- a/xen/common/bitmap.c       Tue Sep 13 10:39:25 2011 +0100
+++ b/xen/common/bitmap.c       Tue Sep 13 10:42:07 2011 +0100
@@ -363,9 +363,8 @@
  * the range.  Output format is compatible with the format
  * accepted as input by bitmap_parselist().
  *
- * The return value is the number of characters which would be
- * generated for the given input, excluding the trailing '\0', as
- * per ISO C99.
+ * The return value is the number of characters which were output,
+ * excluding the trailing '\0'.
  */
 int bitmap_scnlistprintf(char *buf, unsigned int buflen,
        const unsigned long *maskp, int nmaskbits)
@@ -383,6 +382,8 @@
                        rbot = cur;
                }
        }
+       if (!len && buflen)
+               *buf = 0;
        return len;
 }
 EXPORT_SYMBOL(bitmap_scnlistprintf);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] bitmap_scnlistprintf() should always zero-terminate its output buffer, Xen patchbot-4 . 0-testing <=