Hi Michael

> I don't think so, if we check module "vfio", but if given  module name is
> "vfio_xx", it will also correct if use strncmp.

Sorry I missed this the last time. I don't think that is the case. If you do 
strncmp on sizeof(buffer), strncmp will always check 30 bytes. That way if you 
check vfio against vfio_xx, you'll get a mismatch. Of course, replacing fscanf 
with fgets would be better too, to make sure we never go over our buffer size 
when dealing with /proc/modules. 

Thanks,
Anatoly 

Reply via email to