[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-21
From: |
Daniele Forsi |
Subject: |
[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-218-gb6a0d35 |
Date: |
Tue, 10 May 2011 13:32:01 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".
The branch, master has been updated
via b6a0d35f7b3ac0a42949b2dbb275de64f23a4b90 (commit)
from 245dde21c5fe21ce4b01f646cfd61ee66e3facdd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=b6a0d35f7b3ac0a42949b2dbb275de64f23a4b90
commit b6a0d35f7b3ac0a42949b2dbb275de64f23a4b90
Author: Daniele Forsi <address@hidden>
Date: Tue May 10 15:27:24 2011 +0200
Avoid code duplication in gn_mms_nokia2mms() and fill mms->buffer
Also fixes:
gsm-mms.c:574:38: warning: variable 'pdu_start' set but not used
[-Wunused-but-set-variable]
diff --git a/common/gsm-mms.c b/common/gsm-mms.c
index f1e63b1..4146a88 100644
--- a/common/gsm-mms.c
+++ b/common/gsm-mms.c
@@ -571,31 +571,16 @@ gn_error gn_mms_nokia2pdu(const unsigned char
*source_buffer, size_t *source_len
*/
gn_error gn_mms_nokia2mms(const unsigned char *source_buffer, size_t
*source_length, gn_mms *mms)
{
- const unsigned char *nokia_header, *pdu_start;
- size_t mms_length, total_length;
+ gn_error error;
+ const unsigned char *nokia_header;
char string[80];
- if (*source_length < GN_MMS_NOKIA_HEADER_LEN)
- return GN_ERR_WRONGDATAFORMAT;
+ error = gn_mms_nokia2pdu(source_buffer, source_length, &mms->buffer,
&mms->buffer_length);
+ if (error != GN_ERR_NONE)
+ return error;
+ mms->buffer_format = GN_MMS_FORMAT_PDU;
nokia_header = source_buffer;
- pdu_start = nokia_header + GN_MMS_NOKIA_HEADER_LEN;
- mms_length = (nokia_header[4] << 24) + (nokia_header[5] << 16) +
(nokia_header[6] << 8) + nokia_header[7];
- total_length = (nokia_header[8] << 24) + (nokia_header[9] << 16) +
(nokia_header[10] << 8) + nokia_header[11];
-
- dprintf("Nokia header length %d\n", GN_MMS_NOKIA_HEADER_LEN);
- dprintf("\tMMS length %d\n", mms_length);
- dprintf("\tFooter length %d\n", total_length - mms_length -
GN_MMS_NOKIA_HEADER_LEN);
- dprintf("\tTotal length %d\n", total_length);
-
- if (total_length != *source_length) {
- dprintf("ERROR: total_length != source_length (%d != %d)\n",
total_length, *source_length);
- return GN_ERR_WRONGDATAFORMAT;
- }
- if (total_length <= mms_length) {
- dprintf("ERROR: total_length <= mms_length (%d != %d)\n",
total_length, mms_length);
- return GN_ERR_WRONGDATAFORMAT;
- }
/* Decode Nokia header */
-----------------------------------------------------------------------
Summary of changes:
common/gsm-mms.c | 27 ++++++---------------------
1 files changed, 6 insertions(+), 21 deletions(-)
hooks/post-receive
--
libgnokii and core programs
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-218-gb6a0d35,
Daniele Forsi <=