X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=object.c;h=e1feef9c3329e0370e7caff612b4f6c8684cbaef;hb=d1f6c18bd6ea5fd373f9f6356e02854678ffa0fd;hp=7e6a92c88e7b139ec03e0ff26e97e1559a06a220;hpb=bb11eb31a2e7da7f878dd501d39f6877ec00eb7d;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; }