commit - 05ce9a79810689c2365ff7f3a159f1b736f9f06b
commit + bfd30182c6619a969c33209accdca10d77af39f0
blob - bb029b71cf4095537180a0de43f32d6d9e2fac4d
blob + 8428efb9bfb5bc0b42eb6fa2a14059fc8c2e74d1
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
error = got_object_get_type(&obj_type, header->repo, id2);
if (error)
goto done;
-
switch (obj_type) {
case GOT_OBJ_TYPE_BLOB:
error = got_diff_objects_as_blobs(id1, id2, NULL, NULL, 3, 0,
fseek(f, 0, SEEK_SET);
- while ((fgets(buf, 128, f)) != NULL) {
+ while ((fgets(buf, 2048, f)) != NULL) {
n_buf = buf;
while (*n_buf == '\n')
n_buf++;
*newline = ' ';
buf_color = gw_colordiff_line(gw_html_escape(n_buf));
+ if (buf_color == NULL)
+ continue;
+
error = buf_puts(&newsize, diffbuf, buf_color);
if (error)
return NULL;
if (error)
return NULL;
+ if (buf == NULL)
+ return NULL;
if (strncmp(buf, "-", 1) == 0)
color = "diff_minus";
if (strncmp(buf, "+", 1) == 0)