diff options
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/volume_id/get_devname.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c index d82808fa2..4408c2486 100644 --- a/util-linux/volume_id/get_devname.c +++ b/util-linux/volume_id/get_devname.c | |||
| @@ -223,13 +223,11 @@ void display_uuid_cache(void) | |||
| 223 | char *get_devname_from_label(const char *spec) | 223 | char *get_devname_from_label(const char *spec) |
| 224 | { | 224 | { |
| 225 | struct uuidCache_s *uc; | 225 | struct uuidCache_s *uc; |
| 226 | int spec_len = strlen(spec); | ||
| 227 | 226 | ||
| 228 | uuidcache_init(); | 227 | uuidcache_init(); |
| 229 | uc = uuidCache; | 228 | uc = uuidCache; |
| 230 | while (uc) { | 229 | while (uc) { |
| 231 | // FIXME: empty label ("LABEL=") matches anything??! | 230 | if (uc->label[0] && strcmp(spec, uc->label) == 0) { |
| 232 | if (uc->label[0] && strncmp(spec, uc->label, spec_len) == 0) { | ||
| 233 | return xstrdup(uc->device); | 231 | return xstrdup(uc->device); |
| 234 | } | 232 | } |
| 235 | uc = uc->next; | 233 | uc = uc->next; |
