Changeset 385b8b63f121…
Parent 5ec4f546596e…
by Benjamin Pollack
Changes to one file · Browse files at 385b8b63f121 Showing diff from parent 5ec4f546596e Diff from another changeset...
@@ -76,13 +76,14 @@ static char *rev_string(const char revhash[HASH_LENGTH])
{
unsigned ix;
- static char rev_string[HASH_LENGTH * 2];
+ static char rev_string[HASH_LENGTH * 2 + 1];
static char *hexval = "0123456789abcdef";
for (ix = 0; ix < HASH_LENGTH; ++ix)
{
rev_string[ix * 2] = hexval[(revhash[ix] >> 4) & 0xf];
rev_string[ix * 2 + 1] = hexval[revhash[ix] & 0xf];
}
+ rev_string[sizeof(rev_string)] = 0;
return rev_string;
}
|
Loading...