projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed mode_t not defined
[psensor.git]
/
src
/
lib
/
pio.c
diff --git
a/src/lib/pio.c
b/src/lib/pio.c
index
f6ebc73
..
7bb3d7c
100644
(file)
--- a/
src/lib/pio.c
+++ b/
src/lib/pio.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2010-201
4
jeanfi@gmail.com
+ * Copyright (C) 2010-201
6
jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@
-24,13
+24,13
@@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <plog.h>
#include <pio.h>
/* Directory separator is \ when cross-compiling for MS Windows
#include <plog.h>
#include <pio.h>
/* Directory separator is \ when cross-compiling for MS Windows
- systems */
+ * systems
+ */
#if defined(__MINGW32__)
#define DIRSEP ('\\')
#else
#if defined(__MINGW32__)
#define DIRSEP ('\\')
#else
@@
-63,7
+63,7
@@
int is_file(const char *path)
return 0;
}
return 0;
}
-char *dir_normalize(const char *dpath)
+
static
char *dir_normalize(const char *dpath)
{
char *npath;
int n;
{
char *npath;
int n;
@@
-164,6
+164,7
@@
char *file_get_content(const char *fpath)
} else {
FILE *fp = fopen(fpath, "rb");
} else {
FILE *fp = fopen(fpath, "rb");
+
if (fp) {
page = malloc(size + 1);
if (!page || size != fread(page, 1, size, fp)) {
if (fp) {
page = malloc(size + 1);
if (!page || size != fread(page, 1, size, fp)) {