-/* $NetBSD: main.c,v 1.14 1998/08/30 09:19:38 veego Exp $ */
+/* $NetBSD: main.c,v 1.16 2001/02/05 00:57:33 christos Exp $ */
/* main.c */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.14 1998/08/30 09:19:38 veego Exp $");
+__RCSID("$NetBSD: main.c,v 1.16 2001/02/05 00:57:33 christos Exp $");
#endif /* not lint */
#include <sys/types.h>
const char *ptr = 0;
struct passwd *pwe;
+ i = 0;
euid = geteuid();
uid = getuid();
seteuid(uid); /* give up "games" if we have it */
strcpy(savefilename, ptr);
strcat(savefilename, "/Larn.sav"); /* save file name in home
* directory */
- sprintf(optsfile, "%s/.larnopts", ptr); /* the .larnopts filename */
+ snprintf(optsfile, sizeof(optsfile), "%s/.larnopts", ptr);
+ /* the .larnopts filename */
/*
* now malloc the memory for the dungeon
lprintf("\nWhat do you want to %s [* for all] ? ", str);
i = 0;
while (i > 'z' || (i < 'a' && i != '*' && i != '\33' && i != '.'))
- i = getchar();
+ i = lgetchar();
if (i == '\33')
lprcat(" aborted");
return (i);
int i;
unsigned long amt = 0;
sncbr();
- if ((i = getchar()) == '*')
+ if ((i = lgetchar()) == '*')
amt = mx; /* allow him to say * for all gold */
else
while (i != '\n') {
}
if ((i <= '9') && (i >= '0') && (amt < 99999999))
amt = amt * 10 + i - '0';
- i = getchar();
+ i = lgetchar();
}
scbr();
return (amt);