Mercurial > urweb
comparison src/c/urweb.c @ 959:53b9aeac676c
Fix C substring implementation
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Fri, 18 Sep 2009 19:30:09 -0400 |
parents | 38a376dc7401 |
children | 8371d12ae63f |
comparison
equal
deleted
inserted
replaced
958:3aaac251a5af | 959:53b9aeac676c |
---|---|
1910 | 1910 |
1911 if (start + len == full_len) | 1911 if (start + len == full_len) |
1912 return &s[start]; | 1912 return &s[start]; |
1913 else { | 1913 else { |
1914 uw_Basis_string r = uw_malloc(ctx, len+1); | 1914 uw_Basis_string r = uw_malloc(ctx, len+1); |
1915 memcpy(r, s, len); | 1915 memcpy(r, s+start, len); |
1916 r[len] = 0; | 1916 r[len] = 0; |
1917 return r; | 1917 return r; |
1918 } | 1918 } |
1919 | 1919 |
1920 } | 1920 } |