Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

dirstate.cpp: use std::vector as temporary in dirstate::read

Changeset 98c4f12faa6e

Parent 618ae08ce2b7

by Adrian Buehlmann

Changes to one file · Browse files at 98c4f12faa6e Showing diff from parent 618ae08ce2b7 Diff from another changeset...

 
133
134
135
136
137
138
139
140
 
148
149
150
151
152
153
 
 
 
154
155
156
 
133
134
135
 
 
136
137
138
 
146
147
148
 
 
 
149
150
151
152
153
154
@@ -133,8 +133,6 @@
    fread(&pd->parent1, sizeof(char), HASH_LENGTH, f);   fread(&pd->parent2, sizeof(char), HASH_LENGTH, f); - - char temp[MAX_PATH] = "";     while (fread(&e.state, sizeof(e.state), 1, f) == 1)   { @@ -148,9 +146,9 @@
  e.mtime = ntohl(e.mtime);   e.length = ntohl(e.length);   - fread(temp, sizeof(char), e.length, f); - temp[e.length] = 0; - e.name = temp; + std::vector<char> t(e.length+1, 0); + fread(&t[0], sizeof(char), e.length, f); + e.name = &t[0];     pd->add(e);   }