diff autocal/txcalconf.c @ 78:1d3dd589a857

fc-rfcal-txband: implemented check for increasing basis points
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 15 Jul 2017 20:47:31 +0000
parents 5c3574f8c8c1
children a2d4cab0a592
line wrap: on
line diff
--- a/autocal/txcalconf.c	Sat Jul 15 20:25:31 2017 +0000
+++ b/autocal/txcalconf.c	Sat Jul 15 20:47:31 2017 +0000
@@ -47,6 +47,12 @@
 			exit(ERROR_USAGE);
 		}
 		tx_basis[n].apc = atoi(cp);
+		if (n && tx_basis[n].apc <= tx_basis[n-1].apc) {
+			fprintf(stderr,
+				"%s line %d: basis points must be increasing\n",
+				filename_for_errs, lineno);
+			exit(ERROR_USAGE);
+		}
 		while (isdigit(*cp))
 			cp++;
 	}