Public » Mercurial » dirstate
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

null-terminate hash string

Changeset 385b8b63f121

Parent 5ec4f546596e

by Profile picture of Benjamin PollackBenjamin Pollack

Changes to one file · Browse files at 385b8b63f121 Showing diff from parent 5ec4f546596e Diff from another changeset...

Change 1 of 1 Show Entire File dirstate.c Stacked
 
76
77
78
79
 
80
81
82
83
84
85
 
86
87
88
 
76
77
78
 
79
80
81
82
83
84
85
86
87
88
89
@@ -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;  }