Fix some potential problems detected by clang.

Most of these are unnecessary comparisons and functions returning the
wrong types.
This commit is contained in:
John "Elwin" Edwards 2017-09-23 09:47:00 -04:00
parent 614dcfffd2
commit 172c83f254
11 changed files with 24 additions and 25 deletions

View file

@ -200,8 +200,7 @@ main(int argc, char *argv[], char *envp[])
}
if (!use_savedir) {
if ((whoami == NULL) || (*whoami == '\0') ||
(strcmp(whoami,"dosuser")==0))
if ((*whoami == '\0') || (strcmp(whoami,"dosuser")==0))
{
echo();
mvaddstr(23,2,"Rogue's Name? ");
@ -209,7 +208,7 @@ main(int argc, char *argv[], char *envp[])
noecho();
}
if ((whoami == NULL) || (*whoami == '\0'))
if (*whoami == '\0')
strcpy(whoami,"Rodney");
}

View file

@ -132,7 +132,7 @@ md_hasclreol(void)
static int md_standout_mode = 0;
int
void
md_raw_standout(void)
{
#ifdef _WIN32
@ -155,7 +155,7 @@ md_raw_standout(void)
#endif
}
int
void
md_raw_standend(void)
{
#ifdef _WIN32
@ -223,7 +223,7 @@ md_fdopen(int fd, char *mode)
#endif
}
int
void
md_normaluser(void)
{
#ifndef _WIN32
@ -596,7 +596,7 @@ md_rand(void)
#endif
}
int
void
md_srand(int seed)
{
#ifdef _WIN32

View file

@ -1189,12 +1189,12 @@ extern char *md_getroguedir(void);
extern void md_init(void);
extern FILE * md_fdopen(int fd, char *mode);
extern int md_unlink(char *file);
extern int md_normaluser(void);
extern void md_normaluser(void);
extern int md_getuid(void);
extern long md_memused(void);
extern int md_readchar(WINDOW *win);
extern int md_shellescape(void);
extern int md_srand(int seed);
extern void md_srand(int seed);
extern int md_rand(void);
extern int md_erasechar(void);
extern int md_killchar(void);