aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>2011-01-03 01:43:10 -0800
committerDenis Kenzior <denkenz@gmail.com>2011-01-04 10:45:31 -0600
commite99452b822ff69577262b516915c258c08a7d093 (patch)
tree8a0b9f57bdf8c31ec4889845f3a298e9839554b0
parent2ed8d340820001d9bee76fab0eb92c36abd2f593 (diff)
downloadphonesim-e99452b822ff69577262b516915c258c08a7d093.tar.gz
stk: add null text string case
-rw-r--r--src/qsimcommand.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qsimcommand.cpp b/src/qsimcommand.cpp
index f12b8ac..1af2b76 100644
--- a/src/qsimcommand.cpp
+++ b/src/qsimcommand.cpp
@@ -2813,12 +2813,18 @@ void _qtopiaphone_writeTextString( QByteArray& binary, const QString& str,
void _qtopiaphone_writeTextString( QByteArray& binary, const QString& str,
QSimCommand::ToPduOptions options, int tag )
{
- if ( str.isEmpty() && ( options & QSimCommand::EncodeEmptyStrings ) == 0 ) {
- // Special form for zero-length strings.
+ if ( str.isNull() ) {
binary += (char)tag;
binary += (char)0x00;
return;
}
+ if ( str.isEmpty() && ( options & QSimCommand::EncodeEmptyStrings ) == 0 ) {
+ // Special form for empty strings.
+ binary += (char)tag;
+ binary += (char)0x01;
+ binary += (char)options;
+ return;
+ }
int schemeMask = ((tag & 0xFF00) >> 8); // For USSD string output.
if ( ( options & QSimCommand::UCS2Strings ) == 0 ) {
QTextCodec *gsm = QAtUtils::codec( "gsm-noloss" );