fix issues

This commit is contained in:
Max Lv
2013-04-02 16:33:50 +08:00
parent e33a82ff74
commit 5df9644823
6 changed files with 45 additions and 27 deletions
+11 -1
View File
@@ -1,6 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -12,6 +16,12 @@
#define INT_DIGITS 19 /* enough for 64 bit integer */
void ERROR(const char *s) {
char *msg = strerror(errno);
LOGE("%s: %s", s, msg);
}
char *itoa(int i) {
/* Room for INT_DIGITS digits, - and '\0' */
static char buf[INT_DIGITS + 2];
@@ -35,7 +45,7 @@ char *itoa(int i) {
void FATAL(const char *msg) {
fprintf(stderr, "%s", msg);
LOGE("%s", msg);
exit(-1);
}