X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=object.c;h=e1feef9c3329e0370e7caff612b4f6c8684cbaef;hb=5e04a1ee33f82051668f09d73cf16348169e7f1f;hp=7e6a92c88e7b139ec03e0ff26e97e1559a06a220;hpb=0abd52772bcb82a7293bb1c2bd351fbe303abaf1;p=git.git diff --git a/object.c b/object.c index 7e6a92c88..e1feef9c3 100644 --- a/object.c +++ b/object.c @@ -45,7 +45,8 @@ int type_from_string(const char *str) static unsigned int hash_obj(struct object *obj, unsigned int n) { - unsigned int hash = *(unsigned int *)obj->sha1; + unsigned int hash; + memcpy(&hash, obj->sha1, sizeof(unsigned int)); return hash % n; }