From 60422354509e189bb95c2af728a5313bc02b279c Mon Sep 17 00:00:00 2001 From: Jonas Toth Date: Fri, 12 Oct 2018 17:36:04 +0000 Subject: [PATCH] [doc] fix markup in clang-tidy bugprone-not-null-terminated-result llvm-svn: 344379 --- .../checks/bugprone-not-null-terminated-result.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst index 72f465819bab..9a0ce54c5690 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst @@ -55,11 +55,11 @@ Rewrite to a string handler function is not possible: Rewrite based on the destination array: -- If copy to the destination array cannot *overflow then the new function should +- If copy to the destination array cannot overflow then the new function should be the older copy function (ending with ``cpy``), because it is more efficient than the safe version. -- If copy to the destination array can *overflow and +- If copy to the destination array can overflow and ``AreSafeFunctionsAvailable`` is set to ``Yes``, ``y`` or non-zero and it is possible to obtain the capacity of the destination array then the new function could be the safe version (ending with ``cpy_s``). @@ -67,7 +67,7 @@ Rewrite based on the destination array: - If the new function is could be safe version and C++ files are analysed then the length of the destination array can be omitted. -- *It is possible to overflow: +- It is possible to overflow: - Unknown the capacity of the destination array. - If the given length is equal to the destination capacity. @@ -95,17 +95,21 @@ Memory handler functions :ref:`Transformation rules of 'memcpy()'` section. - ``memchr``: + - Usually there is a C-style cast, and it is needed to be removed, because the new function ``strchr``'s return type is correct. - Also the given length is not needed in the new function. - ``memmove``: + - If safe functions are available the new function is ``memmove_s``, it has four arguments: + - destination array, - length of the destination array, - source string, - length of the source string which is incremented by one. + - If safe functions are not available the given length is incremented by one. - ``memmove_s``: given length is incremented by one.