sms: Fix alphanumeric TP-OA handling
authorTommi Kenakkala <tommi.kenakkala@tieto.com>
Fri, 13 Feb 2015 15:50:16 +0000 (17:50 +0200)
committerDenis Kenzior <denkenz@gmail.com>
Fri, 13 Feb 2015 15:49:39 +0000 (09:49 -0600)
commit2af3c733b7a31d755d7dec5b59113b9c73209d16
tree80248de64755263a8abcbab9e8ae55745646d23c
parent604fa223f4a1b7abdf44b5da6c5ca45684f3feac
sms: Fix alphanumeric TP-OA handling

TP-OA max length comparisons were incorrect because TP-OA's 7-bit
coded octets transport eleven 8-bit chars.  The current code assumed
only 10 chars were possible.

The patch
- increases the array size to 23, (maximum of 22 bytes for UTF8
  encoding + null terminator)
- Updates the sanity check to account for the correct maximum
- For encoding, checks the maximum length in UTF8 characters instead of
  bytes
src/smsutil.c
src/smsutil.h