zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #19406
[Merge] lp:~zorba-coders/zorba/msb-misc into lp:zorba
Matthias Brantner has proposed merging lp:~zorba-coders/zorba/msb-misc into lp:zorba.
Commit message:
fix crash on mac
Requested reviews:
Matthias Brantner (matthias-brantner)
Paul J. Lucas (paul-lucas)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/msb-misc/+merge/155267
--
https://code.launchpad.net/~zorba-coders/zorba/msb-misc/+merge/155267
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/api/compiler_api.cpp'
--- src/compiler/api/compiler_api.cpp 2013-03-24 20:40:03 +0000
+++ src/compiler/api/compiler_api.cpp 2013-03-25 15:59:30 +0000
@@ -128,18 +128,19 @@
********************************************************************************/
bool XQueryCompiler::getLanguageMode(std::stringstream& s) const
{
- char lPeek[6];
- s.get(lPeek, 7, ' ');
+ const size_t lPeekSize = 7;
+ char lPeek[lPeekSize];
+ s.get(lPeek, lPeekSize, ' ');
s.clear();
s.seekg(0, s.beg);
bool lXQueryMode;
- if (strncmp(lPeek, "jsoniq", 6) == 0)
+ if (strncmp(lPeek, "jsoniq", lPeekSize - 1) == 0)
{
lXQueryMode = false;
}
- else if (strncmp(lPeek, "xquery", 6) == 0)
+ else if (strncmp(lPeek, "xquery", lPeekSize - 1) == 0)
{
lXQueryMode = true;
}
Follow ups