[PATCH v3 1/3] commit-tree: use prefixcmp instead of memcmp(..., N)
- From
Thomas Rast <tr@thomasrast.ch>
- Date
- Nov 16, 2013, 17:37 UTC
- Message-ID
- <7f7d8c9e211b1eb37fbfd558813fbf2828ef9921.1384622379.git.tr@thomasrast.ch>
- In-Reply-To
- <cover.1384622379.git.tr@thomasrast.ch>
Handrolling the prefix comparison is harder to read and overruns if the argument is an empty string. Use our prefixcmp() instead.
Signed-off-by: Thomas Rast <tr@thomasrast.ch> --- builtin/commit-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c index f641ff2..19d58f9 100644 --- a/builtin/commit-tree.c +++ b/builtin/commit-tree.c @@ -61,7 +61,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix) continue; } - if (!memcmp(arg, "-S", 2)) { + if (!prefixcmp(arg, "-S")) { sign_commit = arg + 2; continue; }
-- 1.8.5.rc2.348.gb73b695