--- smsdaemon/SmsPdu.cpp 2008/06/13 09:09:36 73 +++ smsdaemon/SmsPdu.cpp 2008/12/07 00:59:05 132 @@ -13,11 +13,9 @@ #include "common.h" #include "util.h" -#include using namespace std; - namespace SmsPdu { @@ -146,7 +144,6 @@ const unsigned char UDHI = multipart ? 0x40 : 0; - srand(time(0)); unsigned char csms_ref = rand() % 128; int part_count; @@ -313,19 +310,19 @@ if (UDHI) { int udh_len = (*it++); - cout << "UDH_LEN:" << udh_len << endl; it += udh_len; //just ignore the User Data Header data_len -= udh_len; shift_start = udh_len+1; //make the 8to7bit decode start with the right shift level } - cout << hex<< (int)(*it) << endl;; vector user_data; user_data.insert(user_data.end(), it, it+data_len); - result.message = Decode8to7bit(user_data, shift_start); + result.message = Decode8to7bit(user_data, shift_start).substr(0,data_len); + + result.message = Util::str_trim(result.message); return result;