Whamcloud - gitweb
ChangeLog, get_device_by_label.c:
authorTheodore Ts'o <tytso@mit.edu>
Wed, 25 Oct 2000 02:24:33 +0000 (02:24 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 25 Oct 2000 02:24:33 +0000 (02:24 +0000)
  get_device_by_label.c: Apply fix from Erik Troan to support 16
   character labels.

misc/ChangeLog
misc/get_device_by_label.c

index 048b9a4..9417800 100644 (file)
@@ -1,5 +1,8 @@
 2000-10-24    <tytso@snap.thunk.org>
 
+       * get_device_by_label.c: Apply fix from Erik Troan to support 16
+               character labels.
+
        * fsck.c (device_already_active): Add a special case check for MD
                devices, so we don't try to check them in parallel with
                other devices.
index 72378e7..9ca404a 100644 (file)
@@ -75,7 +75,9 @@ get_label_uuid(const char *device, char **label, char *uuid) {
 
        /* superblock is ext2 - now what is its label? */
        memcpy(uuid, e2sb.s_uuid, sizeof(e2sb.s_uuid));
-       *label = strdup(e2sb.s_volume_name);
+
+       *label = calloc(sizeof(e2sb.s_volume_name) + 1, 1);
+       memcpy(*label, e2sb.s_volume_name, sizeof(e2sb.s_volume_name));
 
        return 0;
 }