fix: correct docs

This commit is contained in:
0xdeadbeer 2024-09-04 09:16:55 +02:00
parent 84055b8c90
commit f879e75636
2 changed files with 7 additions and 8 deletions

9
README
View File

@ -18,11 +18,10 @@ TECHNICALS
int parsme(char **buff, /* out */ struct httpars *pars); int parsme(char **buff, /* out */ struct httpars *pars);
Library is designed to follow source input unaltering. Library is designed to follow source input unaltering.
Which means, that it does not directly alter the input Which suggests, that it does not directly alter the input
data or strings while storing the information of all data or strings while giving users the ability to
parsed results on the stack or as pointers to specific store the parsed information (struct httpars) either on the
parts of the source data. This allows to provide it stack or heap.
with input that resides both within the stack or heap.
LEAKS LEAKS

View File

@ -62,7 +62,7 @@ void fretres(void) {
free(header_tree); free(header_tree);
} }
int read_line(char **buff, char **buff_lim) { int readlin(char **buff, char **buff_lim) {
int diff = 0; int diff = 0;
if ((*buff) >= (*buff_lim)) { if ((*buff) >= (*buff_lim)) {
return diff; return diff;
@ -203,7 +203,7 @@ int parsme(char *buff, struct httpars *pars) {
char *buff_lim = buff+strlen(buff); char *buff_lim = buff+strlen(buff);
char *title_offset = buff; char *title_offset = buff;
int title_len = read_line(&buff, &buff_lim); int title_len = readlin(&buff, &buff_lim);
if ((ret = parstitle(title_offset, title_len, &pars->titl)) < 0) { if ((ret = parstitle(title_offset, title_len, &pars->titl)) < 0) {
fprintf(stderr, "Failed parsing title\n"); fprintf(stderr, "Failed parsing title\n");
return -1; return -1;
@ -211,7 +211,7 @@ int parsme(char *buff, struct httpars *pars) {
for (int bound = 0; bound < MAX_BOUND; bound++) { for (int bound = 0; bound < MAX_BOUND; bound++) {
char *header_offset = buff; char *header_offset = buff;
int header_len = read_line(&buff, &buff_lim); int header_len = readlin(&buff, &buff_lim);
char *header_limit = header_offset+header_len; char *header_limit = header_offset+header_len;
// IF END OF MESSAGE // IF END OF MESSAGE