core: fix "unsigned" bug in sint2str*()
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Wed, 4 Aug 2010 14:22:11 +0000 (16:22 +0200)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Wed, 4 Aug 2010 14:22:11 +0000 (16:22 +0200)
Due to a typo, the sint2str*() functions did not include the sign
most of the times.

ut.h

diff --git a/ut.h b/ut.h
index 18dc46e..1e4b2b4 100644 (file)
--- a/ut.h
+++ b/ut.h
@@ -365,7 +365,7 @@ static inline char* sint2strbuf(long l, char* r, int r_size, int* len)
                l = -l;
        }
        p = int2strbuf((unsigned long)l, r, r_size, &p_len);
-       if(sign && *len<(r_size-1)) {
+       if(sign && p_len<(r_size-1)) {
                *(--p) = '-';
                p_len++;;
        }