]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Revert "blkid: remove unused variable"
authorKarel Zak <kzak@redhat.com>
Tue, 13 May 2014 07:55:10 +0000 (09:55 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 13 May 2014 07:55:10 +0000 (09:55 +0200)
This reverts commit 0fd4b8132587a264f1e0df46eec7c12bba68c752.

misc-utils/blkid.c

index 0d0ea6a222ebcd23a1f7ebae657c5c1ebb7e74cb..b3eade56b445d33d30b4c551571b6331f74dc8e8 100644 (file)
@@ -366,7 +366,7 @@ static void print_tags(blkid_dev dev, char *show[], int output)
 
 static int append_str(char **res, size_t *sz, const char *a, const char *b)
 {
-       char *str;
+       char *str = *res;
        size_t asz = a ? strlen(a) : 0;
        size_t bsz = b ? strlen(b) : 0;
        size_t len = *sz + asz + bsz;
@@ -374,7 +374,7 @@ static int append_str(char **res, size_t *sz, const char *a, const char *b)
        if (!len)
                return -1;
 
-       str = xrealloc(str, len + 1);
+       *res = str = xrealloc(str, len + 1);
        str += *sz;
 
        if (a) {