[sword-cvs] sword/src/utilfuns swbuf.cpp,1.4,1.5
sword@www.crosswire.org
sword@www.crosswire.org
Thu, 27 Feb 2003 11:21:59 -0700
Update of /usr/local/cvsroot/sword/src/utilfuns
In directory www:/tmp/cvs-serv13529
Modified Files:
swbuf.cpp
Log Message:
made c_str() return null-terminated strings!
Index: swbuf.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/utilfuns/swbuf.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** swbuf.cpp 27 Feb 2003 10:41:18 -0000 1.4
--- swbuf.cpp 27 Feb 2003 18:21:57 -0000 1.5
***************
*** 105,109 ****
unsigned int len = newVal.length() + 1;
assureSize(len);
! memcpy(buf, newVal.c_str(), len);
end = buf + (len-1);
}
--- 105,109 ----
unsigned int len = newVal.length() + 1;
assureSize(len);
! memcpy(buf, newVal.raw_buf(), len);
end = buf + (len-1);
}
***************
*** 129,133 ****
unsigned int len = str.length() + 1;
assureSize((end-buf)+len);
! memcpy(end, str.c_str(), len);
end += (len-1);
}
--- 129,133 ----
unsigned int len = str.length() + 1;
assureSize((end-buf)+len);
! memcpy(end, str.raw_buf(), len);
end += (len-1);
}