1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Fix a collection of type / format string mismatches.

Ilya Shipitsin sent me a list of errors reported by a tool 'cppcheck',
which I hadn't seen before, together with some fixes for things
already taken off that list. This change picks out all the things from
the remaining list that I could quickly identify as actual errors,
which it turns out are all format-string goofs along the lines of
using a %d with an unsigned int, or a %u with a signed int, or (in the
cases in charset/utf8.c) an actual _size_ mismatch which could in
principle have caused trouble on a big-endian target.
This commit is contained in:
Simon Tatham
2017-06-20 07:05:39 +01:00
parent 892d4a0188
commit 20e36ae4a2
7 changed files with 11 additions and 9 deletions

View File

@ -267,7 +267,7 @@ void utf8_read_test(int line, char *input, int inlen, ...)
}
if (l != str[i]) {
printf("%d: char %d came out as %08x, should be %08x\n",
line, i, str[i], l);
line, i, str[i], (unsigned)l);
total_errs++;
}
}
@ -306,7 +306,7 @@ void utf8_write_test(int line, const long *input, int inlen, ...)
}
if (l != str[i]) {
printf("%d: char %d came out as %08x, should be %08x\n",
line, i, str[i], l);
line, i, str[i], (unsigned)l);
total_errs++;
}
}