Skip to content

Commit

Permalink
Modify functions in print.c to return > than outlen if they run out o…
Browse files Browse the repository at this point in the history
…f buffer. This is required for correct operation of rlm_rest stream encoders
  • Loading branch information
arr2036 committed Mar 18, 2014
1 parent 3251ac8 commit 45a9371
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 174 deletions.
3 changes: 3 additions & 0 deletions src/include/libradius.h
Expand Up @@ -427,6 +427,9 @@ int fr_check_lib_magic(uint64_t magic);
int fr_utf8_char(uint8_t const *str);
size_t fr_print_string(char const *in, size_t inlen,
char *out, size_t outlen);

#define is_truncated(_ret, _max) ((_ret) <= (_max))
#define truncate_len(_ret, _max) (((_ret) <= (_max)) ? _ret : (_max) - 1)
size_t vp_prints_value(char *out, size_t outlen, VALUE_PAIR const *vp, int8_t quote);
char *vp_aprinttype(TALLOC_CTX *ctx, PW_TYPE type);
char *vp_aprint(TALLOC_CTX *ctx, VALUE_PAIR const *vp);
Expand Down

0 comments on commit 45a9371

Please sign in to comment.