projects
/
platform
/
core
/
system
/
upgrade.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c66a3de
)
blkid-print: fix partition path for /dev/sdX devices
93/299893/1
author
Jacek Kryszyn
<j.kryszyn@samsung.com>
Wed, 11 Oct 2023 12:18:20 +0000
(14:18 +0200)
committer
Jacek Kryszyn
<j.kryszyn@samsung.com>
Wed, 11 Oct 2023 12:18:20 +0000
(14:18 +0200)
This change fixes output in case of partitions on /dev/sdX devices.
Previously comparison of a device name with the "dev/sd" string
using strncmp would always return a value different than 0.
Change-Id: I77c471d174e87a70401cddab5464b8c1f671dc3d
src/blkid-print/blkid-print.c
patch
|
blob
|
history
diff --git
a/src/blkid-print/blkid-print.c
b/src/blkid-print/blkid-print.c
index
bbb3f98
..
17addaf
100644
(file)
--- a/
src/blkid-print/blkid-print.c
+++ b/
src/blkid-print/blkid-print.c
@@
-118,7
+118,7
@@
int main(int argc, char *argv[]) {
char part_path[PATH_MAX];
// /dev/sda1 vs /dev/mmcblk0p1 /dev/nvme0n1p1
// no_separator vs "p" separator
- if (strncmp("/dev/sd", device_name, strlen(
device_name) + 1
) == 0)
+ if (strncmp("/dev/sd", device_name, strlen(
"/dev/sd")
) == 0)
snprintf(part_path, PATH_MAX, "%s%d", device_name, part_nr);
else
snprintf(part_path, PATH_MAX, "%sp%d", device_name, part_nr);