summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/macro.cc
diff options
context:
space:
mode:
authorHurcan Solter <hsolter@gmail.com>2011-05-04 15:40:28 +0300
committerAdam Borowski <kilobyte@angband.pl>2011-06-12 23:47:18 +0200
commitf4333fcef938f6dcd6eefd97c3f8e566b3de4b39 (patch)
tree5e18aa9f1956aa0c052ff5c25c72647f6f3a34ba /crawl-ref/source/macro.cc
parent3895ae9e2b6ebf992ba259250c8e658ada0fa535 (diff)
downloadcrawl-ref-f4333fcef938f6dcd6eefd97c3f8e566b3de4b39.tar.gz
crawl-ref-f4333fcef938f6dcd6eefd97c3f8e566b3de4b39.zip
Fix check if the line is empty before accessing it.
Diffstat (limited to 'crawl-ref/source/macro.cc')
-rw-r--r--crawl-ref/source/macro.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc
index 3967cf3291..269ac347de 100644
--- a/crawl-ref/source/macro.cc
+++ b/crawl-ref/source/macro.cc
@@ -1028,7 +1028,7 @@ static void _read_macros_from(const char* filename)
s = f.get_line();
trim_string(s); // remove white space from ends
- if (s[0] == '#')
+ if (s.empty() || s[0] == '#')
continue; // skip comments
else if (s.substr(0, 2) == "K:")
{