Skip to content

Commit 1c1d12c

Browse files
const at return value of pp_info_get_tlv_value()
1 parent 5a91341 commit 1c1d12c

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/proxy_protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static void tlv_array_clear(tlv_array_t *tlv_array)
263263
tlv_array->tlvs = NULL;
264264
}
265265

266-
uint8_t *pp_info_get_tlv_value(const pp_info_t *pp_info, uint8_t type, uint8_t subtype, uint16_t *value_len_out)
266+
const uint8_t *pp_info_get_tlv_value(const pp_info_t *pp_info, uint8_t type, uint8_t subtype, uint16_t *value_len_out)
267267
{
268268
*value_len_out = 0;
269269
if (!pp_info->tlv_array->tlvs || !pp_info->tlv_array->len)

src/proxy_protocol.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ typedef struct
107107
tlv_array_t *tlv_array;
108108
} pp_info_t;
109109

110-
const char *pp_strerror(int32_t error);
111-
uint8_t *pp_info_get_tlv_value(const pp_info_t *pp_info, uint8_t type, uint8_t subtype, uint16_t *value_len_out);
112-
void pp_info_clear(pp_info_t *pp_info);
110+
const char *pp_strerror(int32_t error);
111+
const uint8_t *pp_info_get_tlv_value(const pp_info_t *pp_info, uint8_t type, uint8_t subtype, uint16_t *value_len_out);
112+
void pp_info_clear(pp_info_t *pp_info);
113113

114114
/*
115115
* version:

tests/test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static uint8_t pp_verify_tlvs(const pp_info_t *pp_info, const test_tlv_t (*expec
115115
if (test_tlv->type != 0)
116116
{
117117
uint16_t tlv_value_len;
118-
uint8_t *tlv_value = pp_info_get_tlv_value(pp_info, test_tlv->type, test_tlv->subtype, &tlv_value_len);
118+
const uint8_t *tlv_value = pp_info_get_tlv_value(pp_info, test_tlv->type, test_tlv->subtype, &tlv_value_len);
119119
if (!tlv_value || tlv_value_len != test_tlv->value_len || memcmp(tlv_value, test_tlv->value, tlv_value_len))
120120
{
121121
return 0;

0 commit comments

Comments
 (0)