[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnokii] 02/04: First SMS location is 1 for nk6510
From: |
Daniele Forsi |
Subject: |
[gnokii] 02/04: First SMS location is 1 for nk6510 |
Date: |
Mon, 11 May 2015 17:27:20 +0000 |
dforsi pushed a commit to branch master
in repository gnokii.
commit d26383c991dc61aff349cd444d60d85a4bdea316
Author: Daniele Forsi <address@hidden>
Date: Mon May 11 19:08:50 2015 +0200
First SMS location is 1 for nk6510
Closes http://savannah.nongnu.org/bugs/?45070
---
ChangeLog | 2 ++
common/phones/nk6510.c | 7 +++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 871bd76..cf6bb03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,8 @@
(Daniele Forsi)
o make GN_OP_PressPhoneKey and GN_OP_ReleasePhoneKey work on
Series 40 3rd (Daniele Forsi)
+ o first SMS number is 1. Fixes
+ http://savannah.nongnu.org/bugs/?45070 (Daniele Forsi)
* xgnokii updates
o fix bug that caused to forget subentries after the first one
when editing the phonebook (Daniele Forsi)
diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index ef23671..20e77d5 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -1484,6 +1484,9 @@ static gn_error ValidateSMS(gn_data *data, struct
gn_statemachine *state)
{
gn_error error;
+ if (data->raw_sms->number < 1)
+ return GN_ERR_INVALIDLOCATION;
+
/* Handle memory_type = 0 explicitly, because sms_folder->folder_id = 0
by default */
if (data->raw_sms->memory_type == 0)
return GN_ERR_INVALIDMEMORYTYPE;
@@ -1531,6 +1534,8 @@ static gn_error NK6510_DeleteSMS(gn_data *data, struct
gn_statemachine *state)
return NK6510_DeleteSMS_S40_30(data, state);
error = ValidateSMS(data, state);
+ if (error != GN_ERR_NONE && error != GN_ERR_NOTSUPPORTED)
+ return error;
if (DRVINSTANCE(state)->pm->flags & PM_SMSFILE || error ==
GN_ERR_NOTSUPPORTED) {
dprintf("NK6510_DeleteSMS: before switch to S40_30\nerror: %s
(%d)\n", gn_error_print(error), error);
/* Try file method */
@@ -1605,6 +1610,8 @@ static gn_error NK6510_GetSMS(gn_data *data, struct
gn_statemachine *state)
return NK6510_GetSMS_S40_30(data, state);
error = ValidateSMS(data, state);
+ if (error != GN_ERR_NONE && error != GN_ERR_NOTSUPPORTED)
+ return error;
if (DRVINSTANCE(state)->pm->flags & PM_SMSFILE || error ==
GN_ERR_NOTSUPPORTED) {
dprintf("NK6510_GetSMS: before switch to S40_30\nerror: %s
(%d)\n", gn_error_print(error), error);
/* Try file method */