You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (strncmp((char*)a, ((structsysfs_class_device*)b)->name,
strlen((char*)a)) ==0)
return1;
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
The text was updated successfully, but these errors were encountered:
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
host1
and there is already a node with namehost12
, it will mistakenly returnshost12
.So my question is why not using
strcmp
? Thank you.Best,
Jiatong Shen
The text was updated successfully, but these errors were encountered: