summaryrefslogtreecommitdiff
path: root/api_test/main.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-06-07 13:24:26 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-06-07 13:24:26 -0700
commit802270f434a72935ba75c725b3cadcae4f478735 (patch)
treeb045b8831ac4c691ce90c41efa8e04b5330918da /api_test/main.c
parent3adc586d9d7539e4d33f737110ffd4e236379099 (diff)
parentfdfa1e4bedf95691389efb9991ac8a6a4599c158 (diff)
Merge pull request #56 from nwellnhof/bufsize_t
Safer handling of string buffer sizes and indices
Diffstat (limited to 'api_test/main.c')
-rw-r--r--api_test/main.c6
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");