diff options
Diffstat (limited to 'src/modules/objects/class_file.cpp')
| -rw-r--r-- | src/modules/objects/class_file.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/modules/objects/class_file.cpp b/src/modules/objects/class_file.cpp index 9e4b2790..89237ed4 100644 --- a/src/modules/objects/class_file.cpp +++ b/src/modules/objects/class_file.cpp @@ -296,8 +296,7 @@ bool KviKvsObject_file::functionputch(KviKvsObjectFunctionCall *c) if (m_pFile) { if (szChar.length()>1)c->warning(__tr2qs("Argument to long, using only first char")); - const char *ch=szChar; - if (m_pFile->putch(ch[0])<0) c->warning(__tr2qs("Write error occured !")); + if (m_pFile->putch(szChar.utf8().data()[0])<0) c->warning(__tr2qs("Write error occured !")); } return true; @@ -328,8 +327,7 @@ bool KviKvsObject_file::functionunGetch(KviKvsObjectFunctionCall *c) else { if (szChar.length()>1) c->warning(__tr2qs("Argument to long, using only first char")); - const char *ch=szChar; - if (m_pFile->ungetch(ch[0])<0) c->warning(__tr2qs("An error occured !"));// c->error ? + if (m_pFile->ungetch(szChar.utf8().data()[0])<0) c->warning(__tr2qs("An error occured !"));// c->error ? } return true; } @@ -365,8 +363,7 @@ bool KviKvsObject_file::functionwriteBlock(KviKvsObjectFunctionCall *c) if (!m_pFile) return true; if(!m_pFile->isOpen()) c->warning(__tr("File is not open !")); - const char *block=szBlock; - int rlen = m_pFile->writeBlock(block, uLen); + int rlen = m_pFile->writeBlock(szBlock.utf8().data(), uLen); c->returnValue()->setInteger(rlen); m_pFile->flush(); return true; @@ -446,4 +443,4 @@ bool KviScriptFileObject::functionHexRead(KviCommand * c, KviParameterList * p, } */ -#include "m_class_file.moc" +#include "class_file.moc" |
