summaryrefslogtreecommitdiff
path: root/decoder/gzstream.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-21 02:54:09 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-21 02:54:09 +0000
commit9c763a8c5863bd7a576cfe67c38672a0cf71b06a (patch)
tree06fb0649b56f1fc9a739b1b90c9c5e49be5b6aa9 /decoder/gzstream.cc
parenta875e8dc40128a3b876dfc0387aa64bb669fabd4 (diff)
vest generate options valgrind fix
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@352 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/gzstream.cc')
-rw-r--r--decoder/gzstream.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/decoder/gzstream.cc b/decoder/gzstream.cc
index 9678355b..88cd1bd2 100644
--- a/decoder/gzstream.cc
+++ b/decoder/gzstream.cc
@@ -51,14 +51,16 @@ gzstreambuf* gzstreambuf::open( const char* name, int open_mode) {
if ((mode & std::ios::ate) || (mode & std::ios::app)
|| ((mode & std::ios::in) && (mode & std::ios::out)))
return (gzstreambuf*)0;
- char fmode[10];
+ const int Nmode=10;
+ char fmode[Nmode];
char* fmodeptr = fmode;
if ( mode & std::ios::in)
*fmodeptr++ = 'r';
else if ( mode & std::ios::out)
*fmodeptr++ = 'w';
*fmodeptr++ = 'b';
- *fmodeptr = '\0';
+ while (fmodeptr<fmode+Nmode) // hopefully wil help valgrind
+ *fmodeptr++ = '\0';
file = gzopen( name, fmode);
if (!file) handle_gzerror();
if (file == 0)