path: root/builtin-show-branch.c
diff options
authorShawn O. Pearce <>2007-03-07 01:44:17 (GMT)
committerJunio C Hamano <>2007-03-07 18:47:10 (GMT)
commit3a55602eeca4ac8670e8698a7187e18b95683344 (patch)
tree625a8af9c4655ace00b275c3e272c2764db3bcb8 /builtin-show-branch.c
parentff1f99453f1fe2fd9470f6ea268aed5a1839bd09 (diff)
General const correctness fixes
We shouldn't attempt to assign constant strings into char*, as the string is not writable at runtime. Likewise we should always be treating unsigned values as unsigned values, not as signed values. Most of these are very straightforward. The only exception is the (unnecessary) xstrdup/free in builtin-branch.c for the detached head case. Since this is a user-level interactive type program and that particular code path is executed no more than once, I feel that the extra xstrdup call is well worth the easy elimination of this warning. Signed-off-by: Shawn O. Pearce <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin-show-branch.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 67ae6ba..c892f1f 100644
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -721,7 +721,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
for (i = 0; i < reflog; i++) {
- char *logmsg, *msg, *m;
+ char *logmsg, *m;
+ const char *msg;
unsigned long timestamp;
int tz;