From: Thomas Rast
Date: Sat, 16 Nov 2013 17:37:55 GMT
Subject: [PATCH v3 1/3] commit-tree: use prefixcmp instead of memcmp(..., N)
Message-ID: <7f7d8c9e211b1eb37fbfd558813fbf2828ef9921.1384622379.git.tr@thomasrast.ch>
In-Reply-To:
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
---
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