summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-01-19 12:30:43 -0500
committerBehdad Esfahbod <behdad@behdad.org>2012-01-19 12:30:43 -0500
commit27c36af411c7c4d75dd25d79fc76dd92c6bb9643 (patch)
tree13f0c2386d91a7bd5751050b5fcc3cdb31bcc58e /util
parent8d2781d69274672303e30522e222bd01c6b5e781 (diff)
Fix OOB in hb-shape
Diffstat (limited to 'util')
-rw-r--r--util/options.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/options.cc b/util/options.cc
index 5ded644e..6585eb4d 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -631,7 +631,7 @@ text_options_t::get_line (unsigned int *len)
char buf[BUFSIZ];
while (fgets (buf, sizeof (buf), fp)) {
unsigned int bytes = strlen (buf);
- if (buf[bytes - 1] == '\n') {
+ if (bytes && buf[bytes - 1] == '\n') {
bytes--;
g_string_append_len (gs, buf, bytes);
break;