aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-31 16:53:02 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-31 16:53:23 +0200
commit2fc528e8ec81a7094229c3eec02a63d30a19e1a1 (patch)
tree0072cc9152bd7fa42f835e5d54721f8feb79434f
parentcfb490561a9edefcd549234b93abaef6d37e353d (diff)
downloadmblaze-2fc528e8ec81a7094229c3eec02a63d30a19e1a1.tar.gz
seq: don't crash when cur link doesn't exist
-rw-r--r--seq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/seq.c b/seq.c
index 96c24fd..c5e9e45 100644
--- a/seq.c
+++ b/seq.c
@@ -265,7 +265,8 @@ blaze822_seq_next(char *map, char *range, struct blaze822_seq_iter *iter)
iter->lines = 1;
find_cur(map, iter);
iter->start = iter->stop = iter->line = iter->cur + 1;
- return strdup(blaze822_seq_cur());
+ char *cur = blaze822_seq_cur();
+ return cur ? strdup(cur) : 0;
} else {
return 0;
}