summaryrefslogtreecommitdiff
path: root/banned.h
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-02 09:38:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-02 18:19:05 (GMT)
commitace5707a803eda0f1dde3d776dc3729d3bc7759a (patch)
tree02bb7073aab1765540244c8595d573d988d19e10 /banned.h
parent0d0ac3826a3bbb9247e39e12623bbcfdd722f24c (diff)
downloadgit-ace5707a803eda0f1dde3d776dc3729d3bc7759a.zip
git-ace5707a803eda0f1dde3d776dc3729d3bc7759a.tar.gz
git-ace5707a803eda0f1dde3d776dc3729d3bc7759a.tar.bz2
banned.h: mark strncat() as banned
strncat() has the same quadratic behavior as strcat() and is difficult-to-read and bug-prone. While it hasn't yet been a problem in git iself, strncat() found it's way into 'master' of cgit and caused segfaults on my system. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'banned.h')
-rw-r--r--banned.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/banned.h b/banned.h
index 28f5937..447af24 100644
--- a/banned.h
+++ b/banned.h
@@ -16,6 +16,8 @@
#define strcat(x,y) BANNED(strcat)
#undef strncpy
#define strncpy(x,y,n) BANNED(strncpy)
+#undef strncat
+#define strncat(x,y,n) BANNED(strncat)
#undef sprintf
#undef vsprintf