Change in ...nfs-ganesha[next]: WIP: Modify strmaxcpy definition to be more graceful!
Malahal has uploaded this change for review. ( https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/441656 Change subject: WIP: Modify strmaxcpy definition to be more graceful! ...................................................................... WIP: Modify strmaxcpy definition to be more graceful! Currently, strmaxcpy() doesn't change the dest buffer if the src buffer couldn't be copied in full. This implies that the callers of strmaxcpy should always check for the return code unless we known for sure that the src length is small in which case we can use strcpy itself. There are callers of strmaxcpy that don't check the return value because they use the dest string for logging purposes only and are lazy. Ideally, strlcpy is best suited for these callers but making strmaxcpy behave like strlcpy (copying a truncated string) doesn't seem to have any downsides. The current implementation of strmaxcpy also forces us to scan the src string twice. Change-Id: I06160ea14155a9000bdba4e331a5aa361921d255 Signed-off-by: Malahal Naineni <malahal@us.ibm.com> --- M src/include/common_utils.h 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/56/441656/1 -- To view, visit https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/441656 To unsubscribe, or for help writing mail filters, visit https://review.gerrithub.io/settings Gerrit-Project: ffilz/nfs-ganesha Gerrit-Branch: next Gerrit-Change-Id: I06160ea14155a9000bdba4e331a5aa361921d255 Gerrit-Change-Number: 441656 Gerrit-PatchSet: 1 Gerrit-Owner: Malahal <malahal@gmail.com> Gerrit-MessageType: newchange
participants (1)
-
Malahal (GerritHub)