mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-05 16:12:13 +00:00
Pl_QPDFTokenizer: Use unsigned_char_pointer instead of copy
This commit is contained in:
parent
13d9756a45
commit
633fb414af
@ -2,6 +2,7 @@
|
|||||||
#include <qpdf/QPDF_String.hh>
|
#include <qpdf/QPDF_String.hh>
|
||||||
#include <qpdf/QPDF_Name.hh>
|
#include <qpdf/QPDF_Name.hh>
|
||||||
#include <qpdf/QTC.hh>
|
#include <qpdf/QTC.hh>
|
||||||
|
#include <qpdf/QUtil.hh>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -26,10 +27,7 @@ Pl_QPDFTokenizer::writeNext(char const* buf, size_t len)
|
|||||||
{
|
{
|
||||||
if (len)
|
if (len)
|
||||||
{
|
{
|
||||||
unsigned char* t = new unsigned char[len];
|
getNext()->write(QUtil::unsigned_char_pointer(buf), len);
|
||||||
memcpy(t, buf, len);
|
|
||||||
getNext()->write(t, len);
|
|
||||||
delete [] t;
|
|
||||||
this->just_wrote_nl = (buf[len-1] == '\n');
|
this->just_wrote_nl = (buf[len-1] == '\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user