]> git.lyx.org Git - features.git/commitdiff
avoid reading uninitialized char c in split()
authorMichael Schmitt <michael.schmitt@teststep.org>
Sat, 16 Jul 2005 17:27:16 +0000 (17:27 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Sat, 16 Jul 2005 17:27:16 +0000 (17:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10254 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/funcrequest.C

index 1799fb99442d62a3db0cee43e4a3ab738fe16737..1f5447ee6b9cc692f7a12aefc1a7aeae97126dbb 100644 (file)
@@ -1,3 +1,7 @@
+2005-07-16  Michael Schmitt  <michael.schmitt@teststep.org>
+
+       * funcrequest.C (split): avoid reading uninitialized char c
+
 2005-07-16  José Matos  <jamatos@fc.up.pt>
 
        * buffer.C:
index 6a9b3fd9a1605e1866b5d756b191265326fcb5c4..ea709c88984960a41c4c4567514e31e055a76475 100644 (file)
@@ -58,20 +58,22 @@ mouse_button::state FuncRequest::button() const
 }
 
 
-void split(vector<string> & args, string str)
+void split(vector<string> & args, string const & str)
 {
        istringstream is(str);
        while (is) {
                char c;
                string s;
                is >> c;
-               if (c == '"')
-                       getline(is, s, '"');
-               else {
-                       is.putback(c);
-                       is >> s;
+               if (is) {
+                       if (c == '"')
+                               getline(is, s, '"');
+                       else {
+                               is.putback(c);
+                               is >> s;
+                       }
+                       args.push_back(s);
                }
-               args.push_back(s);
        }
 }