From 630a6b22ab09792058761f8aefcd0b82aa0c5cec Mon Sep 17 00:00:00 2001
From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Thu, 5 Dec 2002 05:24:32 +0000
Subject: [PATCH] Might be that token is a null string "", so token[1]
 undefined.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@355 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 sm5/smartd.c   | 6 +++---
 sm5/smartd.cpp | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sm5/smartd.c b/sm5/smartd.c
index 946a73915..554460213 100644
--- a/sm5/smartd.c
+++ b/sm5/smartd.c
@@ -49,7 +49,7 @@
 
 // CVS ID strings
 extern const char *CVSid1, *CVSid2;
-const char *CVSid6="$Id: smartd.c,v 1.81 2002/12/01 12:14:16 pjwilliams Exp $" 
+const char *CVSid6="$Id: smartd.c,v 1.82 2002/12/05 05:24:32 ballen4705 Exp $" 
 CVSID1 CVSID2 CVSID3 CVSID4 CVSID7;
 
 // global variable used for control of printing, passing arguments, etc.
@@ -958,7 +958,7 @@ int inttoken(char *arg, char *name, char *token, int lineno, char *configfile, i
 // else zero if it has failed to parse a token.  Or it exits with a
 // directive message if there is a token-parsing problem.
 int parsetoken(char *token,cfgfile *cfg){
-  char sym=token[1];
+  char sym;
   char *name=cfg->name;
   int lineno=cfg->lineno;
   char *delim=" \n\t";
@@ -976,7 +976,7 @@ int parsetoken(char *token,cfgfile *cfg){
   }
   
   // let's parse the token and swallow its argument
-  switch (sym) {
+  switch (sym=token[1]) {
     char *arg;
     int val;
     
diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp
index 69478a7c4..a93772d26 100644
--- a/sm5/smartd.cpp
+++ b/sm5/smartd.cpp
@@ -49,7 +49,7 @@
 
 // CVS ID strings
 extern const char *CVSid1, *CVSid2;
-const char *CVSid6="$Id: smartd.cpp,v 1.81 2002/12/01 12:14:16 pjwilliams Exp $" 
+const char *CVSid6="$Id: smartd.cpp,v 1.82 2002/12/05 05:24:32 ballen4705 Exp $" 
 CVSID1 CVSID2 CVSID3 CVSID4 CVSID7;
 
 // global variable used for control of printing, passing arguments, etc.
@@ -958,7 +958,7 @@ int inttoken(char *arg, char *name, char *token, int lineno, char *configfile, i
 // else zero if it has failed to parse a token.  Or it exits with a
 // directive message if there is a token-parsing problem.
 int parsetoken(char *token,cfgfile *cfg){
-  char sym=token[1];
+  char sym;
   char *name=cfg->name;
   int lineno=cfg->lineno;
   char *delim=" \n\t";
@@ -976,7 +976,7 @@ int parsetoken(char *token,cfgfile *cfg){
   }
   
   // let's parse the token and swallow its argument
-  switch (sym) {
+  switch (sym=token[1]) {
     char *arg;
     int val;
     
-- 
GitLab