[rfc][icedtea-web] Removal of 'magic' numbers and more consistent buffer sizes in C++ side of plugin
adomurad at redhat.com
Thu May 24 07:59:18 PDT 2012
Hey all. This is a response to comments from Pavel on a patch that I
created earlier. I decided to re-post with [rfc] in the name to be
clear. This addresses the issue of magic numbers being used for the
buffer sizes, and the somewhat unclear 'sizeof' usage (that I originally
used) to get the buffer size. As well it avoids using snprintf for
emptying a string, opting for the somewhat clearer strcpy.
2012-05-23 Adam Domurad <adomurad at redhat.com>
Removed instances of snprintf where buffer size was not known.
buffer size constant for allocating buffers for numeric
* plugin/icedteanp/IcedTeaNPPlugin.cc: Removed usage of snprintf
simple blanking of strings. Buffer size was misguided
Used NUM_STR_BUFFER_SIZE constant to replace magic numbers.
* plugin/icedteanp/IcedTeaPluginUtils.cc: Made
NPVariantToString(NPVariant variant, std::string* result) use
indentation. Used NUM_STR_BUFFER_SIZE constant to replace magic
* plugin/icedteanp/IcedTeaPluginUtils.h: Added constant,
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5816 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120524/6fbaf8ac/revised.patch
More information about the distro-pkg-dev