zephyr_tzc_escape_msg and zephyr_tzc_deescape_str refactoring

Review Request #434 — Created Jan. 15, 2021 and submitted

Information

pidgin/pidgin
default
12f17845e9ae

Reviewers

  • Move declarations before implementations. Also slightly change local_zephyr_normalize signature
  • Early return from functions
  • Get strlen(message) once
  • Convert while to for
  • Simplify escaping
  • Remove nulling of last char since newmsg already initialized to 0's

Compile.

Description From Last Updated

I don't see this being used earlier to need the prototype?

QuLogicQuLogic

g_return_... is for incorrect programming; I don't think empty input is incorrect as there are places that explicitly call zephyr_send_message …

QuLogicQuLogic

Not sure about this one as it comes out of some parsed tree thing; it should probably be an explicit …

QuLogicQuLogic
qarkai
QuLogic
  1. 
      
  2. libpurple/protocols/zephyr/zephyr.c (Diff revision 1)
     
     
    Show all issues

    I don't see this being used earlier to need the prototype?

    1. I moved it here and there several times. Basicly added for symmetry with zephyr_tzc_deescape_str. Removed.

  3. libpurple/protocols/zephyr/zephyr.c (Diff revision 1)
     
     
    Show all issues

    g_return_... is for incorrect programming; I don't think empty input is incorrect as there are places that explicitly call zephyr_send_message with an empty string. This should be a plain if.

  4. libpurple/protocols/zephyr/zephyr.c (Diff revision 1)
     
     
    Show all issues

    Not sure about this one as it comes out of some parsed tree thing; it should probably be an explicit if as well.

  5. 
      
qarkai
QuLogic
  1. Ship It!
  2. 
      
grim
Review request changed
Status:
Completed