]> sourceware.org Git - lvm2.git/commitdiff
Fix size of dm_name string.
authorAlasdair Kergon <agk@redhat.com>
Mon, 11 Oct 2004 15:59:23 +0000 (15:59 +0000)
committerAlasdair Kergon <agk@redhat.com>
Mon, 11 Oct 2004 15:59:23 +0000 (15:59 +0000)
WHATS_NEW
lib/misc/lvm-string.c

index c7a5d0b647a53c8b034ce3f2b45dd3ea9a36b67e..d9a521b837650cc4b59d4d1d8dcf1ffe513f1cd8 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,10 +1,10 @@
 Version 2.00.26 - 
 =====================================
+  Fix dm_name string size calculation.
   Improve clvmd error reporting during startup.
   Make clvmd cope with large gaps in node numbers IDs.
   Make clvmd initialisation cope better with debugging output.
   clvmd -V now displays lvm version too.
-  
 
 Version 2.00.25 - 29th September 2004
 =====================================
index a3028dafc5170b76021e0d90603a3bbdb3900a83..652dce0de91c3b4fc736f71dc765e162325b605e 100644 (file)
@@ -134,17 +134,19 @@ static void _quote_hyphens(char **out, const char *src)
 char *build_dm_name(struct pool *mem, const char *vg,
                    const char *lv, const char *layer)
 {
-       size_t len = 0;
-       int hyphens = 0;
+       size_t len = 1;
+       int hyphens = 1;
        char *r, *out;
 
        _count_hyphens(vg, &len, &hyphens);
        _count_hyphens(lv, &len, &hyphens);
 
-       if (layer && *layer)
+       if (layer && *layer) {
                _count_hyphens(layer, &len, &hyphens);
+               hyphens++;
+       }
 
-       len += hyphens + 2;
+       len += hyphens;
 
        if (!(r = pool_alloc(mem, len))) {
                stack;
This page took 0.036237 seconds and 5 git commands to generate.