parent
d4bac51dc8
commit
b3d388ecbf
7
NEWS
7
NEWS
|
@ -1,3 +1,10 @@
|
||||||
|
============
|
||||||
|
Evisum 0.2.0
|
||||||
|
============
|
||||||
|
|
||||||
|
* Add variable unit display (K, M and G).
|
||||||
|
* Minor refactoring.
|
||||||
|
|
||||||
============
|
============
|
||||||
Evisum 0.1.2
|
Evisum 0.1.2
|
||||||
============
|
============
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
See LICENSE file for details.
|
See LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define VERSION "0.1.1"
|
#define VERSION "0.2.0"
|
||||||
|
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
11
src/system.c
11
src/system.c
|
@ -109,7 +109,7 @@ Fcontents(const char *path)
|
||||||
int n = 1024;
|
int n = 1024;
|
||||||
|
|
||||||
buf = malloc(n * sizeof(byte) + 1);
|
buf = malloc(n * sizeof(byte) + 1);
|
||||||
if (!buf) exit(0 << 1);
|
if (!buf) return NULL;
|
||||||
|
|
||||||
while ((count = (fread(byte, sizeof(byte), 1, f))) > 0)
|
while ((count = (fread(byte, sizeof(byte), 1, f))) > 0)
|
||||||
{
|
{
|
||||||
|
@ -118,13 +118,18 @@ Fcontents(const char *path)
|
||||||
{
|
{
|
||||||
n *= 2;
|
n *= 2;
|
||||||
char *tmp = realloc(buf, n * sizeof(byte) + 1);
|
char *tmp = realloc(buf, n * sizeof(byte) + 1);
|
||||||
if (!tmp) exit(1 << 1);
|
if (!tmp) return NULL;
|
||||||
buf = tmp;
|
buf = tmp;
|
||||||
}
|
}
|
||||||
memcpy(&buf[bytes - sizeof(byte)], byte, sizeof(byte));
|
memcpy(&buf[bytes - sizeof(byte)], byte, sizeof(byte));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!feof(f)) exit(2 << 1);
|
if (!feof(f))
|
||||||
|
{
|
||||||
|
free(buf);
|
||||||
|
fclose(f);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
buf[bytes] = 0;
|
buf[bytes] = 0;
|
||||||
|
|
Loading…
Reference in New Issue