Function ndpi_strlcpy

Function Documentation

size_t ndpi_strlcpy(char *dst, const char *src, size_t dst_len, size_t src_len)

Copies src string to dst buffer with length limit.

Copies the string src into dst buffer, limiting the copy length by dst_len. Handles both null-terminated and non null-terminated strings based on src_len. Ensures null-termination in dst if dst_len > 0.

Return
Length of src string
Parameters
  • dst: Destination buffer
  • src: Source string
  • dst_len: Size of dst buffer
  • src_len: Length of src string