gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patches for gsm-sms.c


From: Ulrich Hopp
Subject: Patches for gsm-sms.c
Date: Sun, 5 Jan 2003 00:11:28 +0100
User-agent: KMail/1.4.3

Hi,

while hunting a bug in xgnokii ( not found yet ) I found this in gsm-sms.c :
( please double check the first patch, I'm not sure if  I'm right here, the 
second one is only cosmetic)
#####################################################
static gn_error sms_free_deleted(gn_data *data, int folder)
{
        int i, j;

        if (!data->sms_status) return GN_ERR_INTERNALERROR;

        for (i = 0; i < data->folder_stats[folder]->used; i++) {                
/* for all 
previously found locations */
                if (data->message_list[i][folder]->status == 
GN_SMS_FLD_ToBeRemoved) {  /* 
previously deleted and read message */
                        dprintf("Found deleted message, which will now be 
freed! %i , %i\n",
                                        i, 
data->message_list[i][folder]->location);
                        data->folder_stats[folder]->used--;
##########
we'll never enter the the second for-loop, if we have to delete the first 
message in folder, because  j=i=0 and data->folder_stats[folder]=0
############
                        for (j = i; j < data->folder_stats[folder]->used; j++) {
                                memcpy(data->message_list[j][folder], 
data->message_list[j + 1][folder],
                                                sizeof(gn_sms_message_list));
                        }


Attachment: gsm-sms.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]