From 9e643dad00dbe1a5dcc2a989bb2b767c9863d787 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 11 Jan 2015 12:25:03 +0100 Subject: [PATCH] update: Clean up misuse of wu() in prod_nat() Don't use multiple calls of wu() to print a single line, because that creates a separate telegram for each part. The read command normally merges the telegrams, but if they are more than five seconds apart (clock jumped somehow), we get a telegram header in the middle of a line. Unlikely to happen, but clean it up anyway. The misuse has always been there. Signed-off-by: Markus Armbruster --- src/lib/update/nat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/update/nat.c b/src/lib/update/nat.c index e7325886..d6ccbec2 100644 --- a/src/lib/update/nat.c +++ b/src/lib/update/nat.c @@ -29,6 +29,7 @@ * Known contributors to this file: * Dave Pare, 1989 * Steve McClure, 1997 + * Markus Armbruster, 2006-2015 */ #include @@ -188,9 +189,9 @@ prod_nat(int etu) tlev = levels[n][NAT_TLEV]; rlev = levels[n][NAT_RLEV]; if (tech[n] != 0.0 || res[n] != 0.0) { - wu(0, n, "%5.4f technology (%5.4f + %5.4f), ", - tlev + tech[n], tlev, tech[n]); - wu(0, n, "%5.4f research (%5.4f + %5.4f) produced\n", + wu(0, n, "%5.4f technology (%5.4f + %5.4f), " + "%5.4f research (%5.4f + %5.4f) produced\n", + tlev + tech[n], tlev, tech[n], rlev + res[n], rlev, res[n]); } else wu(0, n, "%5.4f tech, %5.4f research produced\n", tlev, rlev);