Skip to content

Commit

Permalink
Update httpd_parse.c
Browse files Browse the repository at this point in the history
More comments.
  • Loading branch information
Adam5Wu authored Jan 26, 2025
1 parent aa0bfd2 commit af2b7c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/esp_http_server/src/httpd_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,9 @@ esp_err_t httpd_req_get_hdr_value_str(httpd_req_t *r, const char *field, char *v
val_ptr++;
}

/* Get the NULL terminated value and copy it to the caller's buffer. */
/* Get the NULL terminated value and copy it to the caller's buffer.
* Note `strlcpy()` will always return the size of the source string
* including terminimating null.*/
size_t full_size = strlcpy(val, val_ptr, val_size);

/* If buffer length is smaller than needed, return truncation error */
Expand Down

0 comments on commit af2b7c6

Please sign in to comment.