phoenix_info: avoid -Wsometimes-uninitialized compiler warning

Just default the "out" variable in save_part() to "stdout".

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
This commit is contained in:
Bernhard Nortmann 2016-04-13 18:58:49 +02:00
parent 217c440bcf
commit 2519a20481

View File

@ -40,7 +40,7 @@ static int save_part(struct phoenix_ptable *ptable, int part, const char *dest,
{
int l = strlen(dest) + 16;
char outname[l];
FILE *out;
FILE *out = stdout;
char *buf = NULL;
int ret = 0;
snprintf(outname, l, dest, part);
@ -53,8 +53,6 @@ static int save_part(struct phoenix_ptable *ptable, int part, const char *dest,
goto err;
if (strcmp(outname, "-") != 0)
out = fopen(outname, "wb");
else
out = stdout;
if (!out)
goto err;
if (fseek(in, ptable->part[part].start * 0x200, SEEK_SET) == -1)