From 37050e0ebb79a0adf6c41ad88f985cf4fb639998 Mon Sep 17 00:00:00 2001 From: Paul Janzen Date: Thu, 1 Oct 1998 05:31:39 +0000 Subject: 'Spam' winners a bit more safely --- games/larn/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'games/larn/main.c') diff --git a/games/larn/main.c b/games/larn/main.c index 53cd18e0156..48a59cd75eb 100644 --- a/games/larn/main.c +++ b/games/larn/main.c @@ -1,12 +1,13 @@ -/* $OpenBSD: main.c,v 1.8 1998/09/15 05:12:32 pjanzen Exp $ */ +/* $OpenBSD: main.c,v 1.9 1998/10/01 05:31:38 pjanzen Exp $ */ /* $NetBSD: main.c,v 1.12 1998/02/12 08:07:49 mikel Exp $ */ /* main.c */ #ifndef lint -static char rcsid[] = "$OpenBSD: main.c,v 1.8 1998/09/15 05:12:32 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.9 1998/10/01 05:31:38 pjanzen Exp $"; #endif /* not lint */ #include +#include #include #include #include @@ -79,11 +80,11 @@ main(argc, argv) /* can we get it from /etc/passwd? */ if ((pwe = getpwuid(getuid())) != NULL) ptr = pwe->pw_name; +#ifdef NOSPAM else if ((ptr = getenv("LOGNAME")) == 0) - if ((ptr = getenv("USER")) == 0) { - noone: write(2, "Can't find your logname. Who Are You?\n", 39); - exit(1); - } + if ((ptr = getenv("USER")) == 0) +#endif + noone: errx(1, "can't find your logname. Who Are You?"); } if (ptr == 0) goto noone; -- cgit v1.2.3