Commit b75bec94f816a97a3e610bed9f813112e9f316a9

Kirill A. Shutemov 2011-07-15T18:24:35

refs: fix cast warning /home/kas/git/public/libgit2/src/refs.c: In function ‘normalize_name’: /home/kas/git/public/libgit2/src/refs.c:1681:12: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/refs.c b/src/refs.c
index 8022c2b..e2d5f66 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -1679,13 +1679,13 @@ static int check_valid_ref_char(char ch)
 static int normalize_name(char *buffer_out, size_t out_size, const char *name, int is_oid_ref)
 {
 	const char *name_end, *buffer_out_start;
-	char *current;
+	const char *current;
 	int contains_a_slash = 0;
 
 	assert(name && buffer_out);
 
 	buffer_out_start = buffer_out;
-	current = (char *)name;
+	current = name;
 	name_end = name + strlen(name);
 
 	/* Terminating null byte */