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 <t...@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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to