Re: [PATCH] smpp_pdu element reported to long, when at max length
Alexander Malysh <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
yep, Werner is right here. Thanks, Alex Am 25.02.2009 um 09:56 schrieb Werner Coetzee: > > Sorry Arne, but I think you're wrong. > > The check is for a nullterminated element. > Thus, if the SMPP spec specifies max length as an example as 16, > that includes the null terminator, hence you can actually just use > 15 characters. > octstr_len returns the length without the null terminator remember. > > Regards > Werner > > > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of Arne K. Haaje > Sent: 25 February 2009 10:49 > To: [email protected] > Subject: [PATCH] smpp_pdu element reported to long, when at max length > > The check for max length of PDU elements reports "to long", when > element is at > valid max length. > > The check was > > if (octstr_len(p->name) >= max_octets) { \ > warning(0, "SMPP: PDU element <%s> too long " \ > > > I guess this should be > > if (octstr_len(p->name) > max_octets) { \ > warning(0, "SMPP: PDU element <%s> too long " \ > > Arne > -- > -------------------------------- > Arne K. Haaje | www.drx.no > T: 69 51 15 52 | M: 92 88 44 66 > -------------------------------- > > -- > > PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS E-MAIL. > > This e-mail message and all attachments transmitted with it are > confidential and are intended solely for the addressee(s). If the > reader of this message is not the intended recipient, you are hereby > notified that any reading, dissemination, distribution, copying, or > other use of this message or its attachment(s) is strictly prohibited. > >