diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-06-07 13:24:26 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-06-07 13:24:26 -0700 |
commit | 802270f434a72935ba75c725b3cadcae4f478735 (patch) | |
tree | b045b8831ac4c691ce90c41efa8e04b5330918da /api_test | |
parent | 3adc586d9d7539e4d33f737110ffd4e236379099 (diff) | |
parent | fdfa1e4bedf95691389efb9991ac8a6a4599c158 (diff) |
Merge pull request #56 from nwellnhof/bufsize_t
Safer handling of string buffer sizes and indices
Diffstat (limited to 'api_test')
-rw-r--r-- | api_test/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/api_test/main.c b/api_test/main.c index 01df51d..132d48c 100644 --- a/api_test/main.c +++ b/api_test/main.c @@ -643,16 +643,16 @@ test_incomplete_char(test_batch_runner *runner, const char *utf8, static void test_continuation_byte(test_batch_runner *runner, const char *utf8) { - int len = strlen(utf8); + size_t len = strlen(utf8); - for (int pos = 1; pos < len; ++pos) { + for (size_t pos = 1; pos < len; ++pos) { char buf[20]; sprintf(buf, "((((%s))))", utf8); buf[4+pos] = '\x20'; char expected[50]; strcpy(expected, "<p>((((" UTF8_REPL "\x20"); - for (int i = pos + 1; i < len; ++i) { + for (size_t i = pos + 1; i < len; ++i) { strcat(expected, UTF8_REPL); } strcat(expected, "))))</p>\n"); |