diff options
Diffstat (limited to 'miscutils/devfsd.c')
-rw-r--r-- | miscutils/devfsd.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index 96ffe0738..5a6aec6bd 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c | |||
@@ -1405,7 +1405,6 @@ const char *get_old_name(const char *devname, unsigned int namelen, | |||
1405 | int indexx; | 1405 | int indexx; |
1406 | const char *pty1; | 1406 | const char *pty1; |
1407 | const char *pty2; | 1407 | const char *pty2; |
1408 | size_t len; | ||
1409 | /* 1 to 5 "scsi/" , 6 to 9 "ide/host", 10 sbp/, 11 vcc/, 12 pty/ */ | 1408 | /* 1 to 5 "scsi/" , 6 to 9 "ide/host", 10 sbp/, 11 vcc/, 12 pty/ */ |
1410 | static const char *const fmt[] = { | 1409 | static const char *const fmt[] = { |
1411 | NULL , | 1410 | NULL , |
@@ -1425,12 +1424,11 @@ const char *get_old_name(const char *devname, unsigned int namelen, | |||
1425 | }; | 1424 | }; |
1426 | 1425 | ||
1427 | for (trans = translate_table; trans->match != NULL; ++trans) { | 1426 | for (trans = translate_table; trans->match != NULL; ++trans) { |
1428 | len = strlen(trans->match); | 1427 | char *after_match = is_prefixed_with(devname, trans->match); |
1429 | 1428 | if (after_match) { | |
1430 | if (strncmp(devname, trans->match, len) == 0) { | ||
1431 | if (trans->format == NULL) | 1429 | if (trans->format == NULL) |
1432 | return devname + len; | 1430 | return after_match; |
1433 | sprintf(buffer, trans->format, devname + len); | 1431 | sprintf(buffer, trans->format, after_match); |
1434 | return buffer; | 1432 | return buffer; |
1435 | } | 1433 | } |
1436 | } | 1434 | } |