]> git.pond.sub.org Git - empserver/commitdiff
(outid): Fix recovery from bad argument N. Simplify.
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 13 Jun 2005 18:48:54 +0000 (18:48 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 13 Jun 2005 18:48:54 +0000 (18:48 +0000)
src/lib/subs/pr.c

index 710e8aedab0a3e262ee2ce1c73451f0a48ed52a2..9c84549f74ed23dcebbdc42225a37196a62f52a6 100644 (file)
@@ -263,18 +263,15 @@ pr_hilite(s_char *buf)
 static void
 outid(struct player *pl, int n)
 {
 static void
 outid(struct player *pl, int n)
 {
-    s_char c;
-    s_char buf[3];
+    char buf[3];
+
+    if (CANT_HAPPEN(n > C_LAST))
+       n = C_DATA;
 
 
-    if (n > C_LAST) {
-       logerror("outid: %d not valid code\n", n);
-       return;
-    }
     if (n >= 10)
     if (n >= 10)
-       c = 'a' - 10 + n;
+       buf[0] = 'a' - 10 + n;
     else
     else
-       c = '0' + n;
-    buf[0] = c;
+       buf[0] = '0' + n;
     buf[1] = ' ';
     buf[2] = '\0';
     io_puts(pl->iop, buf);
     buf[1] = ' ';
     buf[2] = '\0';
     io_puts(pl->iop, buf);