From 4c4fe98e7eaf0c7d2c776a009ec249d41d3e4491 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 19 Apr 2023 16:57:59 -0400 Subject: [PATCH] More fixes for zpl update... --- project/Bloat.cpp | 4 ++-- project/gen.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/project/Bloat.cpp b/project/Bloat.cpp index e464f48..1ba59fb 100644 --- a/project/Bloat.cpp +++ b/project/Bloat.cpp @@ -70,10 +70,10 @@ sw token_fmt_va( char* buf, uw buf_size, char const* fmt, s32 num_tokens, va_lis TokEntry entry { value, - strnlen(value, (sw)128) + str_len(value, (sw)128) }; - u32 key = crc32( token, strnlen(token, 32) ); + u32 key = crc32( token, str_len(token, 32) ); tokmap_set( & tok_map, key, entry ); } diff --git a/project/gen.cpp b/project/gen.cpp index 7292612..cc242d9 100644 --- a/project/gen.cpp +++ b/project/gen.cpp @@ -2429,11 +2429,11 @@ namespace gen return Code::Invalid; } - char const* name = bprintf( "operator%s", to_str(op) ); + char const* name = str_fmt_buf( "operator%s", to_str(op) ); Code result = make_code(); - result->Name = get_cached_string( name, strnlen(name, MaxNameLength) ); + result->Name = get_cached_string( name, str_len(name, MaxNameLength) ); if (params_code) result->add_entry( params_code ); @@ -3177,7 +3177,7 @@ namespace gen if ( body.Length ) { - memcopy( entries_code, body.Text, body.Length ); + mem_copy( entries_code, body.Text, body.Length ); Code untyped_body = untyped_str( entries_length, entries_code ); @@ -3714,7 +3714,7 @@ namespace gen va_list va; va_start(va, fmt); - sw length = snprintf_va(buf, ZPL_PRINTF_MAXLEN, fmt, va); + sw length = str_fmt_va(buf, ZPL_PRINTF_MAXLEN, fmt, va); va_end(va); Code @@ -3739,7 +3739,7 @@ namespace gen Code result = make_code(); - result->Name = get_cached_string( fmt, strnlen(fmt, MaxNameLength) ); + result->Name = get_cached_string( fmt, str_len(fmt, MaxNameLength) ); result->Type = ECode::Untyped; result->Content = get_cached_string( buf, length );