if (framelen > sizeof(tnc2buf) - 80) {
/* Too much ! Too much! */
return 0;
}
where tnc2buf is a function parameter char tnc2buf. sizeof() has 'unsigned int' type, in a 32-bit binary, sizeof(char ) is 4U so this test re-writes
as:
if (framelen > 4U - 80U) {
which simplifies to:
if (framelen > 4294967224) {
Which I'll say is too much! too much! but sadly has nothing to do with the size of the supplied tnc2buf. Perhaps this test yearns to be:
Lines 148-153 of ax25.c are:
where tnc2buf is a function parameter char tnc2buf. sizeof() has 'unsigned int' type, in a 32-bit binary, sizeof(char ) is 4U so this test re-writes as: if (framelen > 4U - 80U) {
which simplifies to: if (framelen > 4294967224) {
Which I'll say is too much! too much! but sadly has nothing to do with the size of the supplied tnc2buf. Perhaps this test yearns to be: