Lowering the scope And cleaning up some warnings from static analysis

This commit is contained in:
NHOrus 2017-06-14 22:08:43 +03:00 committed by Eric S. Raymond
parent 7c9a0bfb36
commit 46bb20deb3
6 changed files with 11 additions and 15 deletions

View file

@ -33,8 +33,7 @@ int saveresume(FILE *input, bool resume)
{
long i, k;
FILE *fp = NULL;
char *name;
if (!resume) {
/* Suspend. Offer to save things in a file, but charging
* some points (so can't win by using saved games to retry
@ -53,7 +52,7 @@ int saveresume(FILE *input, bool resume)
}
while (fp == NULL) {
name = linenoise("\nFile name: ");
char* name = linenoise("\nFile name: ");
if (name == NULL)
return GO_TOP;
fp = fopen(name,(resume ? READ_MODE : WRITE_MODE));