[ovs-dev] [PATCH 2/5 v1] datapath-windows: add OvsComareString() to compare strings

Nithin Raju nithin at vmware.com
Wed Sep 17 15:33:33 UTC 2014


On Sep 17, 2014, at 6:16 AM, Samuel Ghinet <sghinet at cloudbasesolutions.com>
 wrote:

> I don't think there's a need to implement such a function.
> You can use memcmp, which behaves quite like strncmp.

hi Samuel,
Thanks for the pointer. I was trying to use Rtl* functions, but if memcmp() works, that is great.

I have a couple of questions though that are not clear to me from the documentation:
1. how does memcmp() when the lengths are different? what is the length argument that we need to pass?
2. If the lengths are different, we should be passing the larger length, does memcmp() terminate when it sees the NUL ('\0') character? Obviously passing the smaller length would be wrong.

If memcmp() has the same limitations as RtlCompareMemory() then we need this function.

Thanks,
-- Nithin




More information about the dev mailing list