squid icon indicating copy to clipboard operation
squid copied to clipboard

Improve comment on snmp_core.cc:snmpCreateOidFromStr

Open sergiodj opened this issue 3 years ago • 3 comments

Fix typo and better reflect what the code does.

sergiodj avatar Apr 05 '21 22:04 sergiodj

Can one of the admins verify this patch?

squid-prbot avatar Apr 05 '21 22:04 squid-prbot

Try to convert an OID string representation into binary.

OK.

I still think it's useful to have a comment clarifying possible scenarios which will cause the string not to be parsed, so I've adjusted the comment inside the function.

sergiodj avatar Apr 06 '21 03:04 sergiodj

It should be obvious to anyone reading that code (and thus seeing the comment) what kind of things reach the free and false result.

Comments have to be manually maintained, like what you are doing now. So trying to list every specific case that can reach that free+return section is difficult (eg your comment still misses cases) and forces work onto future devs. The true case(s) are more restricted and thus possibly worth documenting each one (which is already done).

yadij avatar Apr 08 '21 12:04 yadij