summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/oid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/oid.c b/src/oid.c
index 39c222290..72b9511ad 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -49,7 +49,8 @@ int git_oid_mkstr(git_oid *out, const char *str)
{
int p;
for (p = 0; p < sizeof(out->id); p++, str += 2) {
- int v = (from_hex[str[0]] << 4) | from_hex[str[1]];
+ int v = (from_hex[(unsigned char)str[0]] << 4)
+ | from_hex[(unsigned char)str[1]];
if (v < 0)
return GIT_ENOTOID;
out->id[p] = (unsigned char)v;