diff --git a/ncdump/dumplib.c b/ncdump/dumplib.c index 03fe3b278..2ab9d9a3c 100644 --- a/ncdump/dumplib.c +++ b/ncdump/dumplib.c @@ -11,6 +11,7 @@ #include "config.h" #include +#include #include #include #include @@ -203,7 +204,7 @@ sbuf_catb(safebuf_t *s1, const safebuf_t *s2) { size_t res; assert(SAFEBUF_CHECK(s1)); assert(SAFEBUF_CHECK(s2)); - s2len = sbuf_len(s2); + s2len = (size_t)sbuf_len(s2); sbuf_grow(s1, 1 + s1->cl + s2len); res = strlcat(s1->buf + s1->cl, s2->buf, s1->len - s1->cl); assert( res < s1->len ); @@ -212,10 +213,10 @@ sbuf_catb(safebuf_t *s1, const safebuf_t *s2) { } /* Return length of string in sbuf */ -size_t +int sbuf_len(const safebuf_t *sb) { assert(SAFEBUF_CHECK(sb)); - return sb->cl; + return (int)sb->cl; } /* Return C string in an sbuf */ diff --git a/ncdump/dumplib.h b/ncdump/dumplib.h index 7428daf7f..3160fcb3e 100644 --- a/ncdump/dumplib.h +++ b/ncdump/dumplib.h @@ -99,7 +99,7 @@ void sbuf_cat(safebuf_t *sbuf, const char *s2); void sbuf_catb(safebuf_t *s1, const safebuf_t *s2); /* Return length of the string in sbuf */ -size_t sbuf_len(const safebuf_t *sbuf); +int sbuf_len(const safebuf_t *sbuf); /* Return the C string inside an sbuf */ char *sbuf_str(const safebuf_t *sbuf);