From 62fdd55feee7ebae22894386ef74934acc387590 Mon Sep 17 00:00:00 2001
From: uz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Date: Wed, 14 Oct 2009 13:03:47 +0000
Subject: [PATCH] Fixed a problem with SB_GetSym.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4365 b7a2c559-68d2-44c3-8de9-860c34a00d81
---
 src/cc65/scanstrbuf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/cc65/scanstrbuf.c b/src/cc65/scanstrbuf.c
index d33f88a25..f55f52a64 100644
--- a/src/cc65/scanstrbuf.c
+++ b/src/cc65/scanstrbuf.c
@@ -185,7 +185,8 @@ int SB_GetSym (StrBuf* B, StrBuf* Ident, const char* SpecialChars)
             SB_AppendChar (Ident, C);
             SB_Skip (B);
             C = SB_Peek (B);
-        } while (IsIdent (C) || IsDigit (C) || strchr (SpecialChars, C) != 0);
+        } while (IsIdent (C) || IsDigit (C) || 
+                 (C != '\0' && strchr (SpecialChars, C) != 0));
         SB_Terminate (Ident);
      	return 1;
     } else {