Wireshark-bugs: [Wireshark-bugs] [Bug 5753] New dissector for the openSAFETY protocol

Date: Sun, 20 Mar 2011 02:49:10 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5753

Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darkjames@xxxxxxxxxxxxxxxx

--- Comment #6 from Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx> 2011-03-20 02:49:09 PDT ---
My comments, I'm not wireshark developer so you don't need to care :) 

Some cleanup:

+   str = (char *)ep_alloc0 ( sizeof(char)*strlen ( stringToBytes ) + 1);
+   g_snprintf(str, sizeof(char)*strlen ( stringToBytes ) + 1, "%s",
stringToBytes);

I'd replace it with shorter:
    str = ep_strdup(stringToBytes);

+   pb_sendMemBlock = (guint8*) ep_alloc ( sizeof(guint8) * dataLength );
+   memset ( pb_sendMemBlock, 0, dataLength);

with:
    pb_sendMemBlock = ep_alloc0(dataLength);

If you don't use variable or function outside .c file, it's good idea to make
them static.

_U_  is only needed when you don't use this variable in function, if you do,
you don't need to specify it.

You are operating directly on byte array, have you FuzzTest
(http://wiki.wireshark.org/FuzzTesting) this dissector?

Cheers ;)

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.