Skip to content

Commit

Permalink
sms: properly pass the structures sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Oct 24, 2016
1 parent be56415 commit 9c5af6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/sms/libsms_getsms.c
Expand Up @@ -285,7 +285,7 @@ static int splitascii(struct modem *mdm, char *source, struct incame_sms *sms)
start++;
strncpy(sms->ascii,start,sizeof(sms->ascii));
/* force \0 at end */
sms->ascii[sizeof(sms->ascii)] = 0;
sms->ascii[sizeof(sms->ascii) - 1] = 0;
/* get the senders MSISDN */
start=strstr(source,"\",\"");
if (start==0) {
Expand Down Expand Up @@ -314,7 +314,7 @@ static int splitascii(struct modem *mdm, char *source, struct incame_sms *sms)
}
*end=0;
strncpy(sms->name,start,sizeof(sms->name));
sms->name[sizeof(sms->name - 1)] = 0;
sms->name[sizeof(sms->name) - 1] = 0;
}
/* Get the date */
start=end+3;
Expand Down

0 comments on commit 9c5af6e

Please sign in to comment.