From: Yunkai Zhang <[email protected]>

add tailing '\0' to hex buffer

Signed-off-by: Yunkai Zhang <[email protected]>
---
 sheep/farm/sha1_file.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sheep/farm/sha1_file.c b/sheep/farm/sha1_file.c
index b0abc16..493ca79 100644
--- a/sheep/farm/sha1_file.c
+++ b/sheep/farm/sha1_file.c
@@ -270,5 +270,6 @@ char *sha1_to_hex(const unsigned char *sha1)
                *buf++ = hex[val >> 4];
                *buf++ = hex[val & 0xf];
        }
+       buffer[2 * SHA1_LEN] = 0;
        return buffer;
 }
-- 
1.7.11.4

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to