diff --git a/.travis.yml b/.travis.yml index 954fcacc0..e8657f7b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,10 +75,10 @@ matrix: osx_image: xcode7.1 env: C_COMPILER=clang - # clang 4.2 on osx - - os: osx - osx_image: xcode8.2 - env: C_COMPILER=clang + # # clang 4.2 on osx + # - os: osx + # osx_image: xcode8.2 + # env: C_COMPILER=clang before_install: diff --git a/src/cc_print.c b/src/cc_print.c index 7000ff269..22b5ee4ff 100644 --- a/src/cc_print.c +++ b/src/cc_print.c @@ -62,7 +62,7 @@ cc_print_int64_unsafe(char *buf, int64_t n) d = digits(ab); _print_uint64(buf, d, n); - return (n < 0) ? d + 1 : d; + return d + (n < 0); } size_t @@ -86,19 +86,18 @@ cc_print_int64(char *buf, size_t size, int64_t n) size_t d; uint64_t ab = abs_int64(n); - d = digits(ab) + (n < 0); - if (size < d) { + d = digits(ab); + if (size < d + (n < 0)) { return 0; } if (n < 0) { *buf++ = '-'; - d--; } _print_uint64(buf, d, n); - return (n < 0) ? d + 1 : d; + return d + (n < 0); } size_t