Browse Source

refine #269

pull/276/head
Max Lv 10 years ago
parent
commit
434a10b512
3 changed files with 1 additions and 11 deletions
  1. 4
      src/jconf.c
  2. 4
      src/utils.c
  3. 4
      src/utils.h

4
src/jconf.c

@ -37,11 +37,7 @@ static char *to_string(const json_value *value)
if (value->type == json_string) { if (value->type == json_string) {
return ss_strndup(value->u.string.ptr, value->u.string.length); return ss_strndup(value->u.string.ptr, value->u.string.length);
} else if (value->type == json_integer) { } else if (value->type == json_integer) {
#ifdef __MINGW32__
return strdup(ss_itoa(value->u.integer)); return strdup(ss_itoa(value->u.integer));
#else
return strdup(itoa(value->u.integer));
#endif
} else if (value->type == json_null) { } else if (value->type == json_null) {
return "null"; return "null";
} else { } else {

4
src/utils.c

@ -61,11 +61,7 @@ void ERROR(const char *s)
} }
#endif #endif
#ifdef __MINGW32__
char *ss_itoa(int i) char *ss_itoa(int i)
#else
char *itoa(int i)
#endif
{ {
/* Room for INT_DIGITS digits, - and '\0' */ /* Room for INT_DIGITS digits, - and '\0' */
static char buf[INT_DIGITS + 2]; static char buf[INT_DIGITS + 2];

4
src/utils.h

@ -164,15 +164,13 @@ extern int use_syslog;
#endif #endif
#define ERROR(s) ss_error(s) #define ERROR(s) ss_error(s)
char *ss_itoa(int i);
#else #else
void ERROR(const char *s); void ERROR(const char *s);
char *itoa(int i);
#endif #endif
char *ss_itoa(int i);
int run_as(const char *user); int run_as(const char *user);
void FATAL(const char *msg); void FATAL(const char *msg);
void usage(void); void usage(void);

Loading…
Cancel
Save