From 63f94ddb449e22ca9d314bf816cc88da58316a31 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 21 Jan 2021 07:00:05 +0000 Subject: [PATCH] fixed the wrong type specified for the length parameter in hawk_copy_bcstr_to_bchars() and hawk_copy_ucstr_to_uchars() --- hawk/README.md | 6 ++++-- hawk/lib/hawk-utl.h | 4 ++-- hawk/lib/utl-str.c | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hawk/README.md b/hawk/README.md index b7f1bd54..aa15baa7 100644 --- a/hawk/README.md +++ b/hawk/README.md @@ -9,7 +9,9 @@ ## Language -Hawk implements most of the AWK programming language elements with extensions. +Hawk is an AWK interpreter with many extended features implemetned by who 'H' +stands for. It aims to be an easy-to-embed implementation as well as used +standalone. ### Program Structure @@ -675,7 +677,7 @@ The following sample illustrates the basic steps hightlighed above. } /* create a runtime context needed for execution */ - rtx = hawk_rtx_openstd ( + rtx = hawk_rtx_openstd( hawk, 0, HAWK_T("hawk02"), diff --git a/hawk/lib/hawk-utl.h b/hawk/lib/hawk-utl.h index 37b409f9..ecd37342 100644 --- a/hawk/lib/hawk-utl.h +++ b/hawk/lib/hawk-utl.h @@ -516,13 +516,13 @@ HAWK_EXPORT hawk_oow_t hawk_copy_bchars_to_bcstr_unlimited ( HAWK_EXPORT hawk_oow_t hawk_copy_ucstr_to_uchars ( hawk_uch_t* dst, - hawk_uch_t dlen, + hawk_oow_t dlen, const hawk_uch_t* src ); HAWK_EXPORT hawk_oow_t hawk_copy_bcstr_to_bchars ( hawk_bch_t* dst, - hawk_bch_t dlen, + hawk_oow_t dlen, const hawk_bch_t* src ); diff --git a/hawk/lib/utl-str.c b/hawk/lib/utl-str.c index 4b38375a..839463d3 100644 --- a/hawk/lib/utl-str.c +++ b/hawk/lib/utl-str.c @@ -375,7 +375,7 @@ hawk_oow_t hawk_copy_bchars_to_bcstr_unlimited (hawk_bch_t* dst, const hawk_bch_ return i; } -hawk_oow_t hawk_copy_ucstr_to_uchars (hawk_uch_t* dst, hawk_uch_t dlen, const hawk_uch_t* src) +hawk_oow_t hawk_copy_ucstr_to_uchars (hawk_uch_t* dst, hawk_oow_t dlen, const hawk_uch_t* src) { /* no null termination */ hawk_uch_t* p, * p2; @@ -391,7 +391,7 @@ hawk_oow_t hawk_copy_ucstr_to_uchars (hawk_uch_t* dst, hawk_uch_t dlen, const h return p - dst; } -hawk_oow_t hawk_copy_bcstr_to_bchars (hawk_bch_t* dst, hawk_bch_t dlen, const hawk_bch_t* src) +hawk_oow_t hawk_copy_bcstr_to_bchars (hawk_bch_t* dst, hawk_oow_t dlen, const hawk_bch_t* src) { /* no null termination */ hawk_bch_t* p, * p2;