diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-05-30 09:59:10 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-05-30 09:59:10 -0400 |
commit | 0ee7bc2859f77d610ef4a8edd2acce8e5e0fe58c (patch) | |
tree | a464f8a46243a2a77f37e93ab8934b1d7d11f0fc /src/c | |
parent | f69f45d06219f45b7b0d72930f71f215f488641b (diff) |
String.length
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/urweb.c | 8 |
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); |