[OPEN-ILS-DEV] PATCH: bzero is deprecated and unnecessary

Dan Scott denials at gmail.com
Fri Sep 28 23:18:00 EDT 2007


Hi:

snprintf is defined to print a maximum number of characters into a
string, and guarantees to NIL-terminate the string.

The following patch corrects several situations where a string was
defined with 256 characters, but snprintf was called with only 255
characters, meaning that the 256th character would never be reached.
Given that the call to snprintf was preceded by bzero (a deprecated
method of initializing all of the contents of a given string to NIL),
it seems likely that snprintf's NIL-terminating behaviour was
overlooked or forgotten about.

As bzero is deprecated, this patch removes calls to bzero that are
followed by snprintf calls to the same string; the maximum number of
characters specified to snprintf has been corrected, as well.

I think this is trivial enough not to require a DCO. Let me know if
you feel otherwise.

-- 
Dan Scott
Laurentian University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oils_mem.patch
Type: application/octet-stream
Size: 1481 bytes
Desc: not available
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20070928/4579d0d3/oils_mem.obj


More information about the Open-ils-dev mailing list