[MPlayer-dev-eng] [PATCH 1/2] subreader: Split a monster if() into multiple parts.

Nicolas George nicolas.george at normalesup.org
Mon May 26 11:06:06 CEST 2014


Le quintidi 5 prairial, an CCXXII, Reimar Döffinger a écrit :
> Should make code more maintainable.
> Also make sure all input variables are properly
> reset before each test.

I find this a little more readable, but this is still not terribly nice.
Maybe add a comment: /* TODO refactor that to use progressive parsing */.

Also, I suppose you noticed that both the original code suffer from the same
bug: since %n is not counted in the return value, we do not know if the
"%*[^<]<clear/>%n part of the format string has been matched, so match
should not be set just to "sscanf() >= n" but to "sscanf() >= n && plen > 0".

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20140526/5888c0ad/attachment.asc>


More information about the MPlayer-dev-eng mailing list