smsutil: Don't overflow signed ints

We were overflowing the datatype which was causing the 31st segments to
be prepended at position 0.  This resulted in (very) long messages being
improperly concatenated
This commit is contained in:
Denis Kenzior 2010-06-01 10:07:18 -05:00
parent 103961c71b
commit 4638d3ad83
1 changed files with 5 additions and 5 deletions

View File

@ -2483,16 +2483,16 @@ static GSList *sms_assembly_add_fragment_backup(struct sms_assembly *assembly,
guint16 ref, guint8 max, guint8 seq,
gboolean backup)
{
int offset = seq / 32;
int bit = 1 << (seq % 32);
unsigned int offset = seq / 32;
unsigned int bit = 1 << (seq % 32);
GSList *l;
GSList *prev;
struct sms *newsms;
struct sms_assembly_node *node;
GSList *completed;
int position;
int i;
int j;
unsigned int position;
unsigned int i;
unsigned int j;
prev = NULL;