diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/ubi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libbb/ubi.c b/libbb/ubi.c index 34595d797..a90016acf 100644 --- a/libbb/ubi.c +++ b/libbb/ubi.c | |||
@@ -35,6 +35,7 @@ int FAST_FUNC ubi_get_volid_by_name(unsigned ubi_devnum, const char *vol_name) | |||
35 | if (open_read_close(fname, buf, sizeof(buf)) <= 0) | 35 | if (open_read_close(fname, buf, sizeof(buf)) <= 0) |
36 | continue; | 36 | continue; |
37 | 37 | ||
38 | buf[UBI_MAX_VOLUME_NAME] = '\0'; | ||
38 | strchrnul(buf, '\n')[0] = '\0'; | 39 | strchrnul(buf, '\n')[0] = '\0'; |
39 | if (strcmp(vol_name, buf) == 0) | 40 | if (strcmp(vol_name, buf) == 0) |
40 | return i; | 41 | return i; |