diff options
author | 2009-05-30 09:59:10 -0400 | |
---|---|---|
committer | 2009-05-30 09:59:10 -0400 | |
commit | 581a2290590268039cacfbe0762b343f710c3116 (patch) | |
tree | a464f8a46243a2a77f37e93ab8934b1d7d11f0fc /src/c/urweb.c | |
parent | 62c7b094ecf7e618a2e31658994bf648e1b36819 (diff) |
String.length
Diffstat (limited to 'src/c/urweb.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); |