summaryrefslogtreecommitdiffabout
path: root/gammu/emb/gammu/gammu.c
Unidiff
Diffstat (limited to 'gammu/emb/gammu/gammu.c') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/gammu/gammu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gammu/emb/gammu/gammu.c b/gammu/emb/gammu/gammu.c
index a3b93a8..997485a 100644
--- a/gammu/emb/gammu/gammu.c
+++ b/gammu/emb/gammu/gammu.c
@@ -4627,6 +4627,7 @@ static void Restore(int argc, char *argv[])
4627 } 4627 }
4628 DoRestore = false; 4628 DoRestore = false;
4629 if (Backup.Calendar[0] != NULL) { 4629 if (Backup.Calendar[0] != NULL) {
4630 DoRestore = true;
4630 /* N6110 doesn't support getting calendar status */ 4631 /* N6110 doesn't support getting calendar status */
4631 error = Phone->GetNextCalendar(&s,&Calendar,true); 4632 error = Phone->GetNextCalendar(&s,&Calendar,true);
4632 if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { 4633 if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) {
@@ -4678,6 +4679,8 @@ static void Restore(int argc, char *argv[])
4678 if (Backup.ToDo[0] != NULL) { 4679 if (Backup.ToDo[0] != NULL) {
4679 error = Phone->GetToDoStatus(&s,&ToDoStatus); 4680 error = Phone->GetToDoStatus(&s,&ToDoStatus);
4680 if (error == ERR_NONE) { 4681 if (error == ERR_NONE) {
4682 error == ERR_NOTSUPPORTED;
4683 DoRestore = true;
4681 max = 0; 4684 max = 0;
4682 while (Backup.ToDo[max]!=NULL) max++; 4685 while (Backup.ToDo[max]!=NULL) max++;
4683 printmsgerr("%i entries in backup file\n",max); 4686 printmsgerr("%i entries in backup file\n",max);
@@ -4686,8 +4689,10 @@ static void Restore(int argc, char *argv[])
4686 } 4689 }
4687 } 4690 }
4688 if (DoRestore) { 4691 if (DoRestore) {
4692 if ( max > 0 ) {
4689 ToDo = *Backup.ToDo[0]; 4693 ToDo = *Backup.ToDo[0];
4690 error = Phone->SetToDo(&s,&ToDo); 4694 error = Phone->SetToDo(&s,&ToDo);
4695 }
4691 } 4696 }
4692 if (DoRestore && (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED)) { 4697 if (DoRestore && (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED)) {
4693 printmsgerr("Deleting old ToDo: "); 4698 printmsgerr("Deleting old ToDo: ");
@@ -8374,7 +8379,6 @@ int main(int argc, char *argv[])
8374 con->DefaultConnection = false; 8379 con->DefaultConnection = false;
8375 } 8380 }
8376#endif 8381#endif
8377 argc = argc-3;
8378 8382
8379 8383
8380 /* Do we have enough parameters? */ 8384 /* Do we have enough parameters? */