src/c2html.c

changeset 71
d5af9261231d
parent 70
60cecca5e484
equal deleted inserted replaced
70:60cecca5e484 71:d5af9261231d
105 size_t est_cap = 16 + inputbuflen / 40; 105 size_t est_cap = 16 + inputbuflen / 40;
106 106
107 /* create the line pointer array */ 107 /* create the line pointer array */
108 CxList *lines = cxArrayListCreateSimple(CX_STORE_POINTERS, est_cap); 108 CxList *lines = cxArrayListCreateSimple(CX_STORE_POINTERS, est_cap);
109 cxListAdd(lines, inputbuffer); 109 cxListAdd(lines, inputbuffer);
110 for (size_t i = 1; i < inputbuflen; i++) { 110 for (size_t i = 0; i < inputbuflen; i++) {
111 if (inputbuffer[i] == '\n' && i + 1 < inputbuflen) { 111 if (inputbuffer[i] == '\n' && i + 1 < inputbuflen) {
112 cxListAdd(lines, inputbuffer + i + 1); 112 cxListAdd(lines, inputbuffer + i + 1);
113 } 113 }
114 } 114 }
115 115

mercurial