From: Quentin Young Date: Wed, 5 Jul 2017 16:56:52 +0000 (-0400) Subject: zebra: fix mpls_str2label() X-Git-Tag: reindent-master-before~29^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a79d6ebb485f5bb81d576e6d88bf2b00f524d264;p=matthieu%2Ffrr.git zebra: fix mpls_str2label() When making improvements to error handling in this code I accidentally introduced an off-by-one. Fix it. Signed-off-by: Quentin Young --- diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index e08ff08cf6..93844ee2a6 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -1774,7 +1774,7 @@ mpls_str2label (const char *label_str, u_int8_t *num_labels, if (!rc) { - *num_labels = i + 1; + *num_labels = i; memcpy (labels, pl, *num_labels * sizeof (mpls_label_t)); }