Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/gierschv/gsmlib
Browse files Browse the repository at this point in the history
  • Loading branch information
vbouchaud committed Sep 4, 2011
2 parents 1f15f97 + d6f928c commit 50d3c0c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions gsmlib/gsm_phonebook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <gsmlib/gsm_phonebook.h>
#include <gsmlib/gsm_parser.h>
#include <gsmlib/gsm_me_ta.h>
#include <strstream>
#include <sstream>
#include <iostream>
#include <assert.h>
#include <ctype.h>
Expand Down Expand Up @@ -228,15 +228,14 @@ void Phonebook::writeEntry(int index, string telephone, string text)
_myMeTa.setPhonebook(_phonebookName);

// write entry
string s;
std::string s;
if (telephone == "" && text == "")
{
ostrstream os;
std::ostringstream os;
os << "+CPBW=" << index;
os << ends;
char *ss = os.str();
const char *ss = os.str().c_str();
s = string(ss);
delete[] ss;
}
else
{
Expand All @@ -245,16 +244,15 @@ void Phonebook::writeEntry(int index, string telephone, string text)
type = UnknownNumberFormat;
else
type = InternationalNumberFormat;
string gsmText = text;
std::string gsmText = text;
if (lowercase(_myMeTa.getCurrentCharSet()) == "gsm")
gsmText = latin1ToGsm(gsmText);
ostrstream os;
std::ostringstream os;
os << "+CPBW=" << index << ",\"" << telephone << "\"," << type
<< ",\"";
os << ends;
char *ss = os.str();
const char *ss = os.str().c_str();
s = string(ss);
delete[] ss;
// this cannot be added with ostrstream because the gsmText can
// contain a zero (GSM default alphabet for '@')
s += gsmText + "\"";
Expand Down

0 comments on commit 50d3c0c

Please sign in to comment.