add some notes

This commit is contained in:
2025-04-19 19:58:56 +02:00
parent 9f97d6b9fc
commit c3406ca031

View File

@@ -1,6 +1,5 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "../error.h" #include "../error.h"
#include "../util/compat.h" #include "../util/compat.h"
@@ -19,7 +18,8 @@ struct proc_buf_dat {
}; };
/* processes the data within the buffer. /* processes the data within the buffer.
NOTE: when the function returns, eol might not be set, this is to ensure that we know for certain that an EOL indicator has been reached. */ NOTE: when the function returns, eol might not be set, this is to ensure that we know for certain that an EOL indicator has been reached.
BUG: when working with a partial buffer, the returned pointers become invalid */
static void proc_buf(char const* restrict buf, struct proc_buf_dat* restrict dat) { static void proc_buf(char const* restrict buf, struct proc_buf_dat* restrict dat) {
// reset if EOL has been reached // reset if EOL has been reached
if (dat->eol) *dat = (struct proc_buf_dat){0}; if (dat->eol) *dat = (struct proc_buf_dat){0};