static bool
print_attribute_ldif(FILE *fp, const char *name, const char *value)
{
+ const unsigned char *uvalue = (unsigned char *)value;
char *encoded = NULL;
size_t esize;
debug_decl(print_attribute_ldif, SUDOERS_DEBUG_UTIL)
esize = ((vlen + 2) / 3 * 4) + 1;
if ((encoded = malloc(esize)) == NULL)
debug_return_bool(false);
- if (base64_encode(value, vlen, encoded, esize) == (size_t)-1) {
+ if (base64_encode(uvalue, vlen, encoded, esize) == (size_t)-1) {
free(encoded);
debug_return_bool(false);
}
attr = str;
if (encoded) {
/* decode base64 inline and NUL-terminate */
- len = base64_decode(str, attr, strlen(str));
+ len = base64_decode(str, (unsigned char *)attr, strlen(str));
attr[len] = '\0';
}
}
/* Test encode. */
- len = base64_encode(test_strings[i].ascii, strlen(test_strings[i].ascii), buf, sizeof(buf));
+ len = base64_encode((unsigned char *)test_strings[i].ascii,
+ strlen(test_strings[i].ascii), (char *)buf, sizeof(buf));
if (len == (size_t)-1) {
fprintf(stderr, "check_base64: failed to encode %s\n",
test_strings[i].ascii);