sprintf doesn't necessarily return its first arg
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 7 Oct 1987 23:52:27 +0000 (15:52 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 7 Oct 1987 23:52:27 +0000 (15:52 -0800)
SCCS-vsn: games/sail/pl_7.c 5.2

usr/src/games/sail/pl_7.c

index 5ca33a6..c0408d3 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)pl_7.c     5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)pl_7.c     5.2 (Berkeley) %G%";
 #endif not lint
 
 #include "player.h"
 #endif not lint
 
 #include "player.h"
@@ -136,9 +136,11 @@ struct ship *ship;
 {
        static char buf[60];
 
 {
        static char buf[60];
 
-       if (ship != 0)
-               p = sprintf(buf, p, ship->shipname, colours(ship),
+       if (ship != 0) {
+               (void)sprintf(buf, p, ship->shipname, colours(ship),
                        sterncolour(ship));
                        sterncolour(ship));
+               p = buf;
+       }
        sc_prompt = p;
        sc_buf = "";
        sc_hasprompt = 1;
        sc_prompt = p;
        sc_buf = "";
        sc_hasprompt = 1;