Patchwork check-code: also ban strcat

login
register
mail settings
Submitter Augie Fackler
Date March 20, 2016, 12:52 a.m.
Message ID <102b415fc624f1a5f924.1458435129@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/13972/
State Accepted
Headers show

Comments

Augie Fackler - March 20, 2016, 12:52 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1458434942 14400
#      Sat Mar 19 20:49:02 2016 -0400
# Node ID 102b415fc624f1a5f9243e0dd7448233af332d5c
# Parent  d3990da5163799db2b26b27956cb366c5a070d28
check-code: also ban strcat

We're not using it now, so it's easy to ban.
Pierre-Yves David - March 20, 2016, 12:56 a.m.
On 03/19/2016 05:52 PM, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler<augie@google.com>
> # Date 1458434942 14400
> #      Sat Mar 19 20:49:02 2016 -0400
> # Node ID 102b415fc624f1a5f9243e0dd7448233af332d5c
> # Parent  d3990da5163799db2b26b27956cb366c5a070d28
> check-code: also ban strcat
>
> We're not using it now, so it's easy to ban.

Pushed to the clowncopter too. Thanks

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -360,6 +360,7 @@  cpats = [
     (r'[^\n]\Z', "no trailing newline"),
     (r'^\s*#import\b', "use only #include in standard C code"),
     (r'strcpy\(', "don't use strcpy, use strlcpy or memcpy"),
+    (r'strcat\(', "don't use strcat"),
   ],
   # warnings
   []