u_short, ulong exterminated

fdiskXXX: add a bit of sanity (not enough by far)
This commit is contained in:
Denis Vlasenko
2006-12-19 20:32:02 +00:00
parent f58906b646
commit 28703015ab
11 changed files with 90 additions and 95 deletions

View File

@@ -81,14 +81,14 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
struct unipair *up;
int ct = 0, maxct;
int glyph;
u_short unicode;
uint16_t unicode;
maxct = tailsz; /* more than enough */
up = (struct unipair *) xmalloc(maxct * sizeof(struct unipair));
for (glyph = 0; glyph < fontsize; glyph++) {
while (tailsz >= 2) {
unicode = (((u_short) inbuf[1]) << 8) + inbuf[0];
unicode = (((uint16_t) inbuf[1]) << 8) + inbuf[0];
tailsz -= 2;
inbuf += 2;
if (unicode == PSF_SEPARATOR)