summaryrefslogtreecommitdiff
path: root/src/c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-30 09:59:10 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-30 09:59:10 -0400
commit0ee7bc2859f77d610ef4a8edd2acce8e5e0fe58c (patch)
treea464f8a46243a2a77f37e93ab8934b1d7d11f0fc /src/c
parentf69f45d06219f45b7b0d72930f71f215f488641b (diff)
String.length
Diffstat (limited to 'src/c')
-rw-r--r--src/c/urweb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index d399b3bd..cffbb57c 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -1807,8 +1807,12 @@ uw_Basis_string uw_Basis_strsuffix(uw_context ctx, uw_Basis_string s, uw_Basis_i
uw_error(ctx, FATAL, "Out-of-bounds strsuffix");
}
+uw_Basis_int uw_Basis_strlen(uw_context ctx, uw_Basis_string s) {
+ return strlen(s);
+}
+
uw_Basis_string uw_Basis_strcat(uw_context ctx, uw_Basis_string s1, uw_Basis_string s2) {
- int len = strlen(s1) + strlen(s2) + 1;
+ int len = uw_Basis_strlen(ctx, s1) + uw_Basis_strlen(ctx, s2) + 1;
char *s;
uw_check_heap(ctx, len);
@@ -1823,7 +1827,7 @@ uw_Basis_string uw_Basis_strcat(uw_context ctx, uw_Basis_string s1, uw_Basis_str
}
uw_Basis_string uw_strdup(uw_context ctx, uw_Basis_string s1) {
- int len = strlen(s1) + 1;
+ int len = uw_Basis_strlen(ctx, s1) + 1;
char *s;
uw_check_heap(ctx, len);