CalmaRead.c: warning: variable 'libnameptr' is used uninitialized
The local variable 'libnameptr' is used from the 'goto done;' label cleanup but it may not be initiailzied at the time of the first use of the label. When evaluating this I also notice the global 'calmaErrorFile' when closed does not have the handle invalidated. CalmaRead.c:233:9: warning: variable 'libnameptr' is used uninitialized whenever 'if' condition is true CalmaRead.c:231:9: warning: variable 'libnameptr' is used uninitialized whenever 'if' condition is true CalmaRead.c:225:9: warning: variable 'libnameptr' is used uninitialized whenever 'if' condition is true clang18 -Wall warning cleanup [-Wsometimes-uninitialized]
This commit is contained in:
parent
d5ef80acda
commit
95d3e9f85d
|
|
@ -172,7 +172,7 @@ CalmaReadFile(file, filename)
|
||||||
char *filename; /* The real name of the file read */
|
char *filename; /* The real name of the file read */
|
||||||
{
|
{
|
||||||
int k, version;
|
int k, version;
|
||||||
char *libname = NULL, *libnameptr;
|
char *libname = NULL, *libnameptr = NULL;
|
||||||
MagWindow *mw;
|
MagWindow *mw;
|
||||||
static int hdrSkip[] = { CALMA_FORMAT, CALMA_MASK, CALMA_ENDMASKS,
|
static int hdrSkip[] = { CALMA_FORMAT, CALMA_MASK, CALMA_ENDMASKS,
|
||||||
CALMA_REFLIBS, CALMA_FONTS, CALMA_ATTRTABLE,
|
CALMA_REFLIBS, CALMA_FONTS, CALMA_ATTRTABLE,
|
||||||
|
|
@ -309,7 +309,11 @@ done:
|
||||||
HashKill(&calmaDefInitHash);
|
HashKill(&calmaDefInitHash);
|
||||||
UndoEnable();
|
UndoEnable();
|
||||||
|
|
||||||
if (calmaErrorFile != NULL) fclose(calmaErrorFile);
|
if (calmaErrorFile != NULL)
|
||||||
|
{
|
||||||
|
fclose(calmaErrorFile);
|
||||||
|
calmaErrorFile = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue