aboutsummaryrefslogtreecommitdiff
path: root/src/clint.py
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-01-23 21:50:41 +0100
committerGitHub <noreply@github.com>2017-01-23 21:50:41 +0100
commit5892aab1b54b115cc3e74cb0ac59b0034627bf4e (patch)
tree974ccd5d14bb258403f3ec274ac93e8dfd651ca6 /src/clint.py
parentd4b931deacf61528e902623d38d0f4d314bc1839 (diff)
parentb70a5cdd49ecd5f3fe749c1c66a169fee828c66e (diff)
downloadrneovim-5892aab1b54b115cc3e74cb0ac59b0034627bf4e.tar.gz
rneovim-5892aab1b54b115cc3e74cb0ac59b0034627bf4e.tar.bz2
rneovim-5892aab1b54b115cc3e74cb0ac59b0034627bf4e.zip
Merge #5996 from justinmk/coverity-133845
xstrlcat() + coverity fixes
Diffstat (limited to 'src/clint.py')
-rwxr-xr-xsrc/clint.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/clint.py b/src/clint.py
index 0c9f55c71e..df71282362 100755
--- a/src/clint.py
+++ b/src/clint.py
@@ -3166,11 +3166,15 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension,
# Check if some verboten C functions are being used.
if Search(r'\bsprintf\b', line):
error(filename, linenum, 'runtime/printf', 5,
- 'Never use sprintf. Use snprintf instead.')
- match = Search(r'\b(strcpy|strcat)\b', line)
+ 'Use snprintf instead of sprintf.')
+ match = Search(r'\b(STRCPY|strcpy)\b', line)
if match:
error(filename, linenum, 'runtime/printf', 4,
- 'Almost always, snprintf is better than %s' % match.group(1))
+ 'Use xstrlcpy or snprintf instead of %s' % match.group(1))
+ match = Search(r'\b(STRNCAT|strncat)\b', line)
+ if match:
+ error(filename, linenum, 'runtime/printf', 4,
+ 'Use xstrlcat instead of %s' % match.group(1))
# Check for suspicious usage of "if" like
# } if (a == b) {