##// END OF EJS Templates
manifest: perform cheap checks before potentially allocating memory...
Augie Fackler -
r40637:da4478ca default
parent child Browse files
Show More
@@ -137,13 +137,13 b' static int find_lines(lazymanifest *self'
137 137 return MANIFEST_TOO_SHORT_LINE;
138 138 }
139 139 next++; /* advance past newline */
140 if (!realloc_if_full(self)) {
141 return MANIFEST_OOM; /* no memory */
142 }
143 140 if (prev && strcmp(prev, data) > -1) {
144 141 /* This data isn't sorted, so we have to abort. */
145 142 return MANIFEST_NOT_SORTED;
146 143 }
144 if (!realloc_if_full(self)) {
145 return MANIFEST_OOM; /* no memory */
146 }
147 147 l = self->lines + ((self->numlines)++);
148 148 l->start = data;
149 149 l->len = next - data;
General Comments 0
You need to be logged in to leave comments. Login now