[PATCH 4/5] Use exerc instead of ano to choose encoding lengths

Alexandre Oliva lxoliva en fsfla.org
Dom Mar 9 03:29:54 UTC 2014


We key sizes on exerc, not on the calendar year the declaration refers
to, so compare exerc instead of ano.  Also, test latest years first.
---
 rnet_encode.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rnet_encode.c b/rnet_encode.c
index 559b17f..2bf705a 100644
--- a/rnet_encode.c
+++ b/rnet_encode.c
@@ -71,12 +71,12 @@ int rnet_encode(struct rnet_decfile *decfile, struct rnet_message **msg)
 	versao_pgd = strtoul(rnet_decfile_get_header_field(decfile, "nr_versao"), NULL, 10);
 	ret = strtoul(rnet_decfile_get_header_field(decfile, "in_ret"), NULL, 10);
 
-	if (!strcmp(ano, "2013")) {
-		header_start = RNET_HEADER_START_2013;
-		header_end = RNET_HEADER_END_2013;
-	} else if (!strcmp(ano, "2014")) {
+	if (!strcmp(exerc, "2014")) {
 		header_start = RNET_HEADER_START_2014;
 		header_end = RNET_HEADER_END_2014;
+	} else if (!strcmp(exerc, "2013")) {
+		header_start = RNET_HEADER_START_2013;
+		header_end = RNET_HEADER_END_2013;
 	} else {
 		return -EINVAL;
 	}



Más información sobre la lista de distribución Softwares-impostos