mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-07 14:24:14 +01:00
Fix uninitialized vars
Initialized variables that are conditionally set. In particular, this construct is dangerous: void *p; if (something) p = couldReturnNull(); if (!p) p = fallbackFunction();
This commit is contained in:
committed by
Carlos R. Mafra
parent
bbf3635590
commit
12de2f319e
@@ -181,7 +181,7 @@ static Bool isFontOption(char *option)
|
||||
/* XXX: is almost like WINGs/wcolodpanel.c:fetchFile() */
|
||||
void copyFile(char *dir, char *file)
|
||||
{
|
||||
FILE *src, *dst;
|
||||
FILE *src = NULL, *dst = NULL;
|
||||
size_t nread, nwritten, len;
|
||||
char buf[4096];
|
||||
struct stat st;
|
||||
@@ -230,7 +230,9 @@ void copyFile(char *dir, char *file)
|
||||
RETRY( fclose(dst) )
|
||||
|
||||
err:
|
||||
RETRY( fclose(src) )
|
||||
if (src) {
|
||||
RETRY( fclose(src) )
|
||||
}
|
||||
wfree(dstpath);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user