src/c2html.c

changeset 50
17408c3607ce
parent 49
f86f0b054464
child 51
f25ba6fd7a08
     1.1 --- a/src/c2html.c	Tue Aug 23 17:31:15 2016 +0200
     1.2 +++ b/src/c2html.c	Thu Aug 25 11:30:30 2016 +0200
     1.3 @@ -53,7 +53,7 @@
     1.4      ucx_buffer_putc(dest, '\n');
     1.5  }
     1.6  
     1.7 -int formatlines(highlighter_func highlighter,
     1.8 +void formatlines(highlighter_func highlighter,
     1.9          UcxList *in, write_func out, void *stream, int showlineno) {
    1.10      
    1.11      /* compute width of line numbering */
    1.12 @@ -68,7 +68,8 @@
    1.13      /* allocate line buffer */
    1.14      UcxBuffer *line = ucx_buffer_new(NULL, 1024, UCX_BUFFER_AUTOEXTEND);
    1.15      if(!line) {
    1.16 -        return 1;
    1.17 +        perror("Error allocating line buffer for output");
    1.18 +        return;
    1.19      }
    1.20      
    1.21      /* start monospace formatting */
    1.22 @@ -93,7 +94,7 @@
    1.23          /* process code line */
    1.24          highlighter(sourceline->data, line, &multiline_comment);
    1.25          
    1.26 -        /* write code line and reset buffer */
    1.27 +        /* write code line */
    1.28          out(line->space, 1, line->size, stream);
    1.29      }
    1.30      
    1.31 @@ -102,7 +103,6 @@
    1.32      
    1.33      /* cleanup and return */
    1.34      ucx_buffer_free(line);
    1.35 -    return 0;
    1.36  }
    1.37  
    1.38  #define FILEBUF_SIZE 4096

mercurial