certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/libCERTI MessageBuffer.cc


From: certi-cvs
Subject: [certi-cvs] certi/libCERTI MessageBuffer.cc
Date: Wed, 17 Sep 2008 11:59:28 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      08/09/17 11:59:28

Modified files:
        libCERTI       : MessageBuffer.cc 

Log message:
        Fix read_string in order to avoid stupid \0 addition
        and use std::string::assign

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/MessageBuffer.cc?cvsroot=certi&r1=3.11&r2=3.12

Patches:
Index: MessageBuffer.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/MessageBuffer.cc,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- MessageBuffer.cc    23 Jun 2008 13:25:05 -0000      3.11
+++ MessageBuffer.cc    17 Sep 2008 11:59:27 -0000      3.12
@@ -438,12 +438,9 @@
  char* buf;
  
  read_int32(&len);
- buf = new char[len+1];
+ buf = new char[len];
  read_chars(buf,len);
- /* terminate the string */
- buf[len] = '\0';
- /* build an std::string and retrun it */
- retval = std::string(buf);
+ retval.assign(buf,len);
  delete[] buf;
  return retval;
 } /* end of read_string */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]