From: SourceForge.net <no...@so...> - 2009-11-12 14:46:36
|
Patches item #2895013, was opened at 2009-11-09 22:18 Message generated for change (Comment added) made by russellbryant You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=303248&aid=2895013&group_id=3248 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: BZFS Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Russell Bryant (russellbryant) Assigned to: Nobody/Anonymous (nobody) Summary: Remove an unnecessary instance of malloc()/memcpy()/free() Initial Comment: This patch improves a small piece of code by removing an unnecessary memory allocation. ---------------------------------------------------------------------- >Comment By: Russell Bryant (russellbryant) Date: 2009-11-12 08:46 Message: I assumed that data is always a valid string (because it was being tacked on to a std::string, theData). If the data is not a string, then "theData += p" could produce some odd results with the existing code. If it's just opaque data, then it could have embedded nulls in it, causing not all of the data to make it into theData. ---------------------------------------------------------------------- Comment By: Tupone Alfredo (atupone) Date: 2009-11-10 02:22 Message: You have to be sure that data is a null terminated string to do that ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=303248&aid=2895013&group_id=3248 |