X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=sha1_file.c;h=54648282592d85cea0b1d42e02f358c240991ce2;hb=0cc9e70c4c9adb3e79b4a492f2f989c611d85966;hp=f2d33afb27f6c73ad6c177098fe2f2674add7fbe;hpb=24735cfc500feb2a8dba9f140080ab3476363d28;p=git.git diff --git a/sha1_file.c b/sha1_file.c index f2d33afb..54648282 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -108,9 +108,10 @@ int safe_create_leading_directories(char *path) char * sha1_to_hex(const unsigned char *sha1) { - static char buffer[50]; + static int bufno; + static char hexbuffer[4][50]; static const char hex[] = "0123456789abcdef"; - char *buf = buffer; + char *buffer = hexbuffer[3 & ++bufno], *buf = buffer; int i; for (i = 0; i < 20; i++) {