value_pair_tmpl_t vpt;
vp_cursor_t cursor, to_merge;
VALUE_PAIR *vp, *head = NULL;
- size_t slen;
+ ssize_t slen;
int count = 0;
char const *p = fmt;
char delim;
while (isspace((int) *p)) p++;
length = strtoul(p, &end, 10);
- if ((length <= 0) || (length == ULONG_MAX) || (length > 8192)) {
+ if ((length == ULONG_MAX) || (length > 8192)) {
talloc_free(vpt);
RDEBUG("Invalid length found at: %s", p);
return false;
char const *fmt, char *out, size_t outlen)
{
char fill;
- size_t pad, len;
+ size_t pad;
+ ssize_t len;
value_pair_tmpl_t *vpt;
*out = '\0';
len = tmpl_expand(NULL, out, pad + 1, request, vpt, NULL, NULL);
if (len <= 0) return 0;
- if (len >= pad) return pad;
+ if ((size_t) len >= pad) return pad;
/*
* We have to shift the string to the right, and pad with
char const *fmt, char *out, size_t outlen)
{
char fill;
- size_t pad, len;
+ size_t pad;
+ ssize_t len;
value_pair_tmpl_t *vpt;
*out = '\0';
len = tmpl_expand(NULL, out, pad + 1, request, vpt, NULL, NULL);
if (len <= 0) return 0;
- if (len >= pad) return pad;
+ if ((size_t) len >= pad) return pad;
/*
* We have to pad with "fill" characters.