projects
/
fw
/
openocd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Dick Hollenbeck <dick@softplc.com> convert macros to inline fn's.
[fw/openocd]
/
src
/
helper
/
configuration.c
diff --git
a/src/helper/configuration.c
b/src/helper/configuration.c
index a8d3bd2270b2c292d49c0e840ace2542dd5a6519..e33a2e1688946dd3c8ea912c95531775bfffee62 100644
(file)
--- a/
src/helper/configuration.c
+++ b/
src/helper/configuration.c
@@
-81,7
+81,7
@@
char *find_file(const char *file)
snprintf(full_path, 1024, "%s/%s", dir, file);
fp = fopen(full_path, mode);
}
snprintf(full_path, 1024, "%s/%s", dir, file);
fp = fopen(full_path, mode);
}
-
+
if (fp)
{
fclose(fp);
if (fp)
{
fclose(fp);
@@
-91,7
+91,6
@@
char *find_file(const char *file)
return NULL;
}
return NULL;
}
-
FILE *open_file_from_path (char *file, char *mode)
{
if (mode[0]!='r')
FILE *open_file_from_path (char *file, char *mode)
{
if (mode[0]!='r')
@@
-100,6
+99,8
@@
FILE *open_file_from_path (char *file, char *mode)
} else
{
char *full_path=find_file(file);
} else
{
char *full_path=find_file(file);
+ if (full_path==NULL)
+ return NULL;
FILE *fp = NULL;
fp = fopen(full_path, mode);
free(full_path);
FILE *fp = NULL;
fp = fopen(full_path, mode);
free(full_path);