]> git.pond.sub.org Git - empserver/commitdiff
update: Clean up misuse of wu() in prod_nat()
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 11 Jan 2015 11:25:03 +0000 (12:25 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:49 +0000 (08:20 +0100)
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 <armbru@pond.sub.org>
src/lib/update/nat.c

index e7325886046931049b5ad372b03eaa430e06f6ff..d6ccbec26e1d32babbd790af8acd38d6ed8f4ba1 100644 (file)
@@ -29,6 +29,7 @@
  *  Known contributors to this file:
  *     Dave Pare, 1989
  *     Steve McClure, 1997
+ *     Markus Armbruster, 2006-2015
  */
 
 #include <config.h>
@@ -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);