Fresco/Babylon/src Char.cc,1.9,1.10
Tobias Hunger <[email protected]> Thu, 18 Dec 2003 19:56:05 +0100
| Newsgroups | gmane.comp.video.fresco.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs/fresco/Fresco/Babylon/src
In directory purcel:/tmp/cvs-serv29382/src
Modified Files:
Char.cc
Log Message:
Do not use auto_ptr in conjunction with arrays.
Index: Char.cc
===================================================================
RCS file: /cvs/fresco/Fresco/Babylon/src/Char.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Char.cc 1 Aug 2003 16:47:15 -0000 1.9
+++ Char.cc 18 Dec 2003 18:55:39 -0000 1.10
@@ -47,15 +47,15 @@
// prepare output buffer
// 16Byte should be more then enough to encode two characters;-)
- std::auto_ptr<char> out_buf(new char[16]);
+ std::vector<char> out_buf(16);
size_t out_bound(16);
iconv_wrapper(Babylon::internal_format,
reinterpret_cast<const char *>(&my_value), in_bound,
- format, out_buf.get(), out_bound);
+ format, &out_buf[0], out_bound);
// put result into a string
- std::string result(out_buf.get(), 16 - out_bound);
+ std::string result(&out_buf[0], 16 - out_bound);
return result;
}