*
*/
-VALUE_PAIR *rc_avpair_add (VALUE_PAIR **list, int attrid, void *pval, int len,
+VALUE_PAIR *rc_avpair_add (VALUE_PAIR **list, int attrid, const void *pval, int len,
int vendorcode)
{
VALUE_PAIR *vp;
*
*/
-int rc_avpair_assign (VALUE_PAIR *vp, void *pval, int len)
+int rc_avpair_assign (VALUE_PAIR *vp, const void *pval, int len)
{
int result = -1;
{
case PW_TYPE_STRING:
- if (((len == 0) && (strlen ((char *) pval)) > AUTH_STRING_LEN)
+ if (((len == 0) && (strlen ((const char *) pval)) > AUTH_STRING_LEN)
|| (len > AUTH_STRING_LEN)) {
error("rc_avpair_assign: bad attribute length");
return result;
}
if (len > 0) {
- memcpy(vp->strvalue, (char *)pval, len);
+ memcpy(vp->strvalue, (const char *)pval, len);
vp->strvalue[len] = '\0';
vp->lvalue = len;
} else {
- strncpy ((char*) vp->strvalue, (char *) pval, AUTH_STRING_LEN);
- vp->lvalue = strlen((char *) pval);
+ strncpy ((char*) vp->strvalue, (const char *) pval, AUTH_STRING_LEN);
+ vp->lvalue = strlen((const char *) pval);
}
result = 0;
*
*/
-VALUE_PAIR *rc_avpair_new (int attrid, void *pval, int len, int vendorcode)
+VALUE_PAIR *rc_avpair_new (int attrid, const void *pval, int len, int vendorcode)
{
VALUE_PAIR *vp = (VALUE_PAIR *) NULL;
DICT_ATTR *pda;
else /* look for the "p" entry in the "a" list (or run to end) */
{
this_node = *a;
- while (this_node != (VALUE_PAIR *) NULL)
+ while (this_node->next != (VALUE_PAIR *) NULL)
{
if (this_node == p)
{