comparison src/edl.c @ 13:41b74137e201

include: make header guards sane double underscores are reserved to the implementation by the C standard
author Paper <paper@paper.us.eu.org>
date Wed, 03 Apr 2024 20:48:51 -0400
parents 0cc2555db371
children 2d7c810a1ac2
comparison
equal deleted inserted replaced
12:0cc2555db371 13:41b74137e201
96 { 96 {
97 const char* ln = memchr(&data[offset], '\n', length - offset); 97 const char* ln = memchr(&data[offset], '\n', length - offset);
98 if (!ln) 98 if (!ln)
99 return -1; 99 return -1;
100 100
101 newline = ln - &data[offset]; 101 newline = ln ? (ln - &data[offset]) : length;
102 } 102 }
103 103
104 EDL_internal_header_reallocate(header, 32); 104 EDL_internal_header_reallocate(header, 32);
105 105
106 for (; overall <= newline; overall++) { 106 for (; overall <= newline; overall++) {
402 EDL_internal_string_init(&ret); 402 EDL_internal_string_init(&ret);
403 403
404 EDL_internal_string_append(&ret, order_str, strlen(order_str)); 404 EDL_internal_string_append(&ret, order_str, strlen(order_str));
405 405
406 { 406 {
407 /* how? */
408 EDL_header header = {0}; 407 EDL_header header = {0};
409 if (EDL_internal_parse_header(&header, order_str, 0, strlen(order_str)) < 0) 408 if (EDL_internal_parse_header(&header, order_str, 0, strlen(order_str)) < 0)
410 return NULL; 409 return NULL; /* how? */
411 410
412 size_t i; 411 size_t i;
413 for (i = 0; i < edl->size; i++) 412 for (i = 0; i < edl->size; i++)
414 EDL_dump_line(&ret, &edl->arr[i], &header); 413 EDL_dump_line(&ret, &edl->arr[i], &header);
415 414