From 89d81377fd5cc415227bf58857bb2cb34ee5a7f2 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Wed, 28 May 2014 10:40:58 +1200 Subject: [PATCH] demangle: fix prototype mismatch. We declared the function to take size_t, but it really expected int. The implementation is changed to use size_t throughout. Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749434 --- util/demangle.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util/demangle.c b/util/demangle.c index 31ad8d6..7b53747 100644 --- a/util/demangle.c +++ b/util/demangle.c @@ -26,14 +26,14 @@ /* Buffer in which the demangler result will be constructed. */ struct dmbuf { char *out; - int max_len; - int len; + size_t max_len; + size_t len; }; /* Add a chunk of text to the buffer */ -static int dm_append(struct dmbuf *d, const char *text, int len) +static int dm_append(struct dmbuf *d, const char *text, size_t len) { - int i; + size_t i; if (d->len + len + 1 > d->max_len) return -1; @@ -68,7 +68,7 @@ static int dm_component(struct dmbuf *d, const char *text, const char **out) } /* Demangler interface */ -int demangle(const char *raw, char *out, int max_len) +int demangle(const char *raw, char *out, size_t max_len) { struct dmbuf d;