diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-25 14:36:14 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-25 14:36:14 +0000 |
commit | 09f38e21c1a69bc0b00a72b954bd88b9545bb1c5 (patch) | |
tree | aee35b155ca06c0ccff476fda990d8cbf10dd4fc | |
parent | 18a1d996edde4845394090642ce03ec083c5761b (diff) |
coverity#1266483 String not null terminated
Change-Id: I4d22e5a621d36fa2e914891e82ce7e8e06f60b4c
-rw-r--r-- | vcl/source/opengl/OpenGLHelper.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index af1d8e77de50..372f0bd9cdbb 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -50,10 +50,8 @@ OString loadShader(const OUString& rFilename) boost::scoped_array<char> content(new char[nSize+1]); sal_uInt64 nBytesRead = 0; aFile.read(content.get(), nSize, nBytesRead); - if(nSize != nBytesRead) - assert(false); - - content[nSize] = 0; + assert(nSize == nBytesRead); + content[nBytesRead] = 0; return OString(content.get()); } else |