From b3a2f90e54bcb32a88d13539e5672993c5037638 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 3 Nov 2008 18:00:49 -0800 Subject: [PATCH] Enable warnings by default and fix warning in oid.c Signed-off-by: Shawn O. Pearce --- Makefile | 2 +- src/oid.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8c7af5e16..bbd29af5b 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ all:: DOXYGEN = doxygen -CFLAGS = -g -O2 +CFLAGS = -g -O2 -Wall OS = unix BASIC_CFLAGS := -Iinclude 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;