summaryrefslogtreecommitdiff
path: root/builtin-mailinfo.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-03-07 01:44:17 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-03-07 18:47:10 (GMT)
commit3a55602eeca4ac8670e8698a7187e18b95683344 (patch)
tree625a8af9c4655ace00b275c3e272c2764db3bcb8 /builtin-mailinfo.c
parentff1f99453f1fe2fd9470f6ea268aed5a1839bd09 (diff)
downloadgit-3a55602eeca4ac8670e8698a7187e18b95683344.zip
git-3a55602eeca4ac8670e8698a7187e18b95683344.tar.gz
git-3a55602eeca4ac8670e8698a7187e18b95683344.tar.bz2
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 <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-mailinfo.c')
-rw-r--r--builtin-mailinfo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 766a37e..f54e875 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -545,10 +545,10 @@ static int decode_b_segment(char *in, char *ot, char *ep)
return 0;
}
-static void convert_to_utf8(char *line, char *charset)
+static void convert_to_utf8(char *line, const char *charset)
{
- static char latin_one[] = "latin1";
- char *input_charset = *charset ? charset : latin_one;
+ static const char latin_one[] = "latin1";
+ const char *input_charset = *charset ? charset : latin_one;
char *out = reencode_string(line, metainfo_charset, input_charset);
if (!out)