Hello,
I have a question about the following code,
|
if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name, |
|
strlen((char *)a)) == 0) |
|
return 1; |
In the code, it will compare input with target using the length of input, but if input is something like host1 and there is already a node with name host12, it will mistakenly returns host12.
So my question is why not using strcmp? Thank you.
Best,
Jiatong Shen
Hello,
I have a question about the following code,
sysfsutils/lib/sysfs_class.c
Lines 68 to 70 in 7655f5a
In the code, it will compare input with target using the length of input, but if input is something like
host1and there is already a node with namehost12, it will mistakenly returnshost12.So my question is why not using
strcmp? Thank you.Best,
Jiatong Shen