Commit 91b29c55 authored by Lev Walkin's avatar Lev Walkin

size_t instead of confusing ssize_t

parent 5ccf1eb5
......@@ -3,7 +3,6 @@
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <constr_TYPE.h>
#include <ber_tlv_length.h>
#include <ber_tlv_tag.h>
......@@ -117,7 +116,7 @@ ber_skip_length(int _is_constructed, void *ptr, size_t size) {
/* UNREACHABLE */
}
ssize_t
size_t
der_tlv_length_serialize(ber_tlv_len_t len, void *bufp, size_t size) {
size_t required_size; /* Size of len encoding */
uint8_t *buf = (uint8_t *)bufp;
......
......@@ -31,10 +31,10 @@ ssize_t ber_skip_length(int _is_constructed, void *bufptr, size_t size);
/*
* This function serializes the length (L from TLV) in DER format.
* It always return number of bytes necessary to represent the length,
* It always returns number of bytes necessary to represent the length,
* it is a caller's responsibility to check the return value
* against the supplied buffer's size.
*/
ssize_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size);
size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size);
#endif /* _BER_TLV_LENGTH_H_ */
......@@ -3,7 +3,6 @@
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
#include <constr_TYPE.h>
#include <ber_tlv_tag.h>
#include <errno.h>
......@@ -100,7 +99,7 @@ ber_tlv_tag_string(ber_tlv_tag_t tag) {
}
ssize_t
size_t
ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufp, size_t size) {
int tclass = BER_TAG_CLASS(tag);
ber_tlv_tag_t tval = BER_TAG_VALUE(tag);
......
......@@ -43,10 +43,10 @@ ssize_t ber_fetch_tag(void *bufptr, size_t size, ber_tlv_tag_t *tag_r);
/*
* This function serializes the tag (T from TLV) in BER format.
* It always return number of bytes necessary to represent the tag,
* It always returns number of bytes necessary to represent the tag,
* it is a caller's responsibility to check the return value
* against the supplied buffer's size.
*/
ssize_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size);
size_t ber_tlv_tag_serialize(ber_tlv_tag_t tag, void *bufptr, size_t size);
#endif /* _BER_TLV_TAG_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment