X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=radmsg.c;fp=radmsg.c;h=7f6dd9dd305b1ac0bf61c7e0f8f5cc4d2b8559d1;hb=43446949664ce2000fa6cd7c62687355c2c440e2;hp=6e339905955d546d0a28dccaf4bc4e089ba406cf;hpb=26c8061a9b931a817756946863fea057dd81b656;p=libradsec.git diff --git a/radmsg.c b/radmsg.c index 6e33990..7f6dd9d 100644 --- a/radmsg.c +++ b/radmsg.c @@ -106,9 +106,7 @@ struct tlv *radmsg_gettype(struct radmsg *msg, uint8_t type) { * If all attributes were copied successfully, the number of * attributes copied is returned. * - * If copying failed, a negative number is returned. The number - * returned is 0 minus the number of attributes successfully copied - * before the failure. */ + * If copying failed, a negative number is returned. */ int radmsg_copy_attrs(struct radmsg *dst, const struct radmsg *src, uint8_t type) @@ -119,7 +117,7 @@ int radmsg_copy_attrs(struct radmsg *dst, for (node = list_first(list); node; node = list_next(node)) { if (radmsg_add(dst, copytlv((struct tlv *) node->data)) != 1) { - n = -n; + n = -1; break; } n++;