> > + /* Skip UTF8 BOM */ > > + if (buf->str[0] == '\xef' && buf->str[1] == '\xbb' && buf->str[2] == > > '\xbf') > > You could use strncmp() here. And for good mesure, you could check > buf->len. Something like this:
I first intentionally decided against strncmp, but now I can't recall why. So, I switched to it and surely also check the length. Note to self: Don't fix bugs at 4am...
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/ gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel