X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilcbuffmt.c;h=838177d183932c0bb5a9fa465d572ca5b1df459c;hb=ccdddda33bec54d464d667dbf05fb2307e8a7e87;hp=6534696384896110510b0844fa623379fb38f49b;hpb=5e00e06129a497cfb8b82e6756cf0800e7c57bb2;p=runtime.git diff --git a/lib/silcutil/silcbuffmt.c b/lib/silcutil/silcbuffmt.c index 65346963..838177d1 100644 --- a/lib/silcutil/silcbuffmt.c +++ b/lib/silcutil/silcbuffmt.c @@ -16,9 +16,8 @@ GNU General Public License for more details. */ -/* $Id$ */ -#include "silc.h" +#include "silcruntime.h" /************************** Types and definitions ***************************/ @@ -180,7 +179,7 @@ int silc_buffer_sformat_vp_i(SilcStack stack, SilcBuffer dst, va_list ap, case SILC_PARAM_REGEX: { const char *regex = va_arg(ap, char *); - SilcBufferRegexFlags rflags = va_arg(ap, SilcUInt32); + SilcBufferRegexFlags rflags = va_arg(ap, SilcBufferRegexFlags); SilcBufferStruct match; SilcBool match_all = (rflags & SILC_STR_REGEX_ALL) != 0; SilcBool match_nl = (rflags & SILC_STR_REGEX_NL) != 0; @@ -284,7 +283,7 @@ int silc_buffer_sformat_vp_i(SilcStack stack, SilcBuffer dst, va_list ap, if (x && tmp_len) { FORMAT_HAS_SPACE(stack, dst, tmp_len); - silc_buffer_put(dst, x, tmp_len); + silc_buffer_put(dst, (unsigned char *)x, tmp_len); silc_buffer_pull(dst, tmp_len); } break; @@ -669,7 +668,7 @@ int silc_buffer_sunformat_vp_i(SilcStack stack, SilcBuffer src, va_list ap, case SILC_PARAM_REGEX: { const char *regex = va_arg(ap, char *); - SilcBufferRegexFlags rflags = va_arg(ap, SilcUInt32); + SilcBufferRegexFlags rflags = va_arg(ap, SilcBufferRegexFlags); SilcBufferStruct match; SilcBool match_all = (rflags & SILC_STR_REGEX_ALL) != 0; SilcBool match_nl = (rflags & SILC_STR_REGEX_NL) != 0; @@ -1245,11 +1244,12 @@ int silc_buffer_sunformat_vp_i(SilcStack stack, SilcBuffer src, va_list ap, return -1; ok: + len = src->data - start_ptr; + /* Push the buffer back to the start. */ - if (process && !advance) { - len = src->data - start_ptr; + if (process && !advance) silc_buffer_push(src, len); - } + return len; }