aboutsummaryrefslogtreecommitdiff
path: root/builtins/text.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-14 14:57:01 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-14 14:57:01 -0400
commit9c2d7c437d7576b44f4cf0e6b6a293acd7188a5d (patch)
treef77b86d59c258f2e1d9834f8acc7c68da68af01a /builtins/text.c
parentc8af1ac9c12073776fda6af7ae58f9d6e2d81e66 (diff)
Fix up type conversions with ints and nums
Diffstat (limited to 'builtins/text.c')
-rw-r--r--builtins/text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtins/text.c b/builtins/text.c
index 754eef91..22784a34 100644
--- a/builtins/text.c
+++ b/builtins/text.c
@@ -255,7 +255,7 @@ public CORD Text$replace(CORD text, CORD pat, CORD replacement, Int_t int_limit)
if (!text || !pat) return text;
CORD ret = CORD_EMPTY;
size_t pos = 0, pat_len = CORD_len(pat);
- int64_t limit = Int$as_i64(int_limit);
+ int64_t limit = Int_to_Int64(int_limit, false);
for (size_t found; limit != 0 && (found=CORD_str(text, pos, pat)) != CORD_NOT_FOUND; --limit) {
ret = CORD_all(ret, CORD_substr(text, pos, found - pos), replacement);
pos = found + pat_len;