Make struct telstr members tel_type and tel_length unsigned
They are simpler to use that way.
This commit is contained in:
parent
d2cd46ce20
commit
4c81ca34cb
6 changed files with 23 additions and 26 deletions
|
@ -114,11 +114,7 @@ rea(void)
|
|||
lasttype = -1;
|
||||
while (fread(&tgm, sizeof(tgm), 1, telfp) == 1) {
|
||||
readit = 1;
|
||||
if (tgm.tel_length < 0) {
|
||||
logerror("bad telegram file header in %s", mbox);
|
||||
break;
|
||||
}
|
||||
if (tgm.tel_type < 0 || tgm.tel_type > TEL_LAST) {
|
||||
if (tgm.tel_type > TEL_LAST) {
|
||||
pr("Bad telegram header. Skipping telegram...\n");
|
||||
readit = 0;
|
||||
goto skip;
|
||||
|
@ -146,7 +142,7 @@ rea(void)
|
|||
pr("\n> ");
|
||||
lastcnum = tgm.tel_from;
|
||||
lasttype = tgm.tel_type;
|
||||
pr("%s ", telnames[(int)tgm.tel_type]);
|
||||
pr("%s ", telnames[tgm.tel_type]);
|
||||
if ((tgm.tel_type == TEL_NORM) ||
|
||||
(tgm.tel_type == TEL_ANNOUNCE) ||
|
||||
(tgm.tel_type == TEL_BULLETIN))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue