From 9c763a8c5863bd7a576cfe67c38672a0cf71b06a Mon Sep 17 00:00:00 2001 From: graehl Date: Wed, 21 Jul 2010 02:54:09 +0000 Subject: vest generate options valgrind fix git-svn-id: https://ws10smt.googlecode.com/svn/trunk@352 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/gzstream.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'decoder/gzstream.cc') 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