X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=common%2Fgsm-sms.c;h=9fbb1148f1366c541e1a52f92aeb65ad3f8df345;hp=5a35034fb9d0784c6c50d29c5447ea04d6f26a36;hb=2a2206f128cdd3ef136166e586026c774da5c490;hpb=a2dfc99dc499ea8600bf5178f8122125d7d7d557 diff --git a/common/gsm-sms.c b/common/gsm-sms.c index 5a35034..9fbb114 100644 --- a/common/gsm-sms.c +++ b/common/gsm-sms.c @@ -491,7 +491,7 @@ GSM_Error GSM_DecodeETSISMSSubmitData(GSM_SMSMessage *SMS, GSM_ETSISMSMessage *E fprintf(stdout, " 7 bit SMS, body is (length %i): ",SMS->Length); #endif /* DEBUG */ - DecodeDefault (SMS->MessageText, output, tmp); + DecodeDefault (SMS->MessageText, output, SMS->Length); #ifdef DEBUG fprintf(stdout, "%s\n",SMS->MessageText); @@ -730,6 +730,7 @@ GSM_Error GSM_EncodeETSISMSSubmitValidity(GSM_SMSMessage *SMS,GSM_ETSISMSMessage GSM_Error GSM_EncodeETSISMS(GSM_SMSMessage *SMS, GSM_ETSISMSMessage *ETSI, SMS_MessageType PDU, int *length) { int size=0; + GSM_Error error; ETSI->firstbyte=0; ETSI->TPPID=0; @@ -749,8 +750,10 @@ GSM_Error GSM_EncodeETSISMS(GSM_SMSMessage *SMS, GSM_ETSISMSMessage *ETSI, SMS_M /* Mask for request for delivery report from SMSC */ if (SMS->Type == GST_DR) ETSI->firstbyte |= 32; - GSM_EncodeETSISMSSubmitHeader(SMS, ETSI); - GSM_EncodeETSISMSSubmitValidity(SMS, ETSI); + error=GSM_EncodeETSISMSSubmitHeader(SMS, ETSI); + if (error!=GE_NONE) return error; + error=GSM_EncodeETSISMSSubmitValidity(SMS, ETSI); + if (error!=GE_NONE) return error; size=GSM_EncodeETSISMSSubmitData(SMS, ETSI); break; @@ -760,7 +763,8 @@ GSM_Error GSM_EncodeETSISMS(GSM_SMSMessage *SMS, GSM_ETSISMSMessage *ETSI, SMS_M /* Bits 1 and 0: 00. SMS-Deliver */ ETSI->firstbyte |= 0x00; - GSM_EncodeETSISMSSubmitHeader(SMS, ETSI); + error=GSM_EncodeETSISMSSubmitHeader(SMS, ETSI); + if (error!=GE_NONE) return error; GSM_EncodeSMSDateTime(&SMS->Time, ETSI->DeliveryDateTime); size=GSM_EncodeETSISMSSubmitData(SMS, ETSI);