summaryrefslogtreecommitdiff
path: root/l10ntools/source/gConv.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'l10ntools/source/gConv.cxx')
-rw-r--r--l10ntools/source/gConv.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/l10ntools/source/gConv.cxx b/l10ntools/source/gConv.cxx
index 1070e88fa565..39f08259ad87 100644
--- a/l10ntools/source/gConv.cxx
+++ b/l10ntools/source/gConv.cxx
@@ -191,29 +191,28 @@ bool convert_gen::prepareFile()
-int convert_gen::lexRead(char *sBuf, int nMax_size)
+void convert_gen::lexRead(char *sBuf, size_t *result, size_t nMax_size)
{
- int nResult = 0;
-
// did we hit eof
- if (miSourceReadIndex != -1) {
+ if (miSourceReadIndex == -1)
+ *result = 0;
+ else {
// assume we can copy all that are left.
- nResult = msSourceBuffer.size() - miSourceReadIndex;
+ *result = msSourceBuffer.size() - miSourceReadIndex;
// space enough for the whole line ?
- if (nResult <= nMax_size) {
- msSourceBuffer.copy(sBuf, nResult, miSourceReadIndex);
+ if (*result <= nMax_size) {
+ msSourceBuffer.copy(sBuf, *result, miSourceReadIndex);
l10nMem::showDebug(sBuf);
miSourceReadIndex = -1;
}
else {
msSourceBuffer.copy(sBuf, nMax_size, miSourceReadIndex);
l10nMem::showDebug(sBuf);
- nResult = nMax_size;
+ *result = nMax_size;
miSourceReadIndex += nMax_size;
}
}
- return nResult;
}