Shut up bogus warning about possible uninitialized use

- The way manageFile() is called, fmode can never be uninitialized
  but lets make gcc happy by adding a default case to the switch...
- Additionally make fmode const because it is
This commit is contained in:
Panu Matilainen 2014-06-30 11:20:19 +03:00
parent e48ac41ebb
commit 2273916148
1 changed files with 2 additions and 1 deletions

View File

@ -49,7 +49,7 @@ static int closeFile(FD_t *fdp)
static int manageFile(FD_t *fdp, const char *fn, int flags)
{
FD_t fd;
char *fmode;
const char *fmode;
if (fdp == NULL || fn == NULL) /* programmer error */
return 1;
@ -63,6 +63,7 @@ static int manageFile(FD_t *fdp, const char *fn, int flags)
case O_RDONLY:
fmode = "r.ufdio";
break;
default:
case O_RDWR:
fmode = "r+.ufdio";
break;