mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
add some dle sanity checking into onlyifset()
This commit is contained in:
+6
-1
@@ -17,7 +17,12 @@
|
||||
static char *
|
||||
onlyifset(Line *l)
|
||||
{
|
||||
char *ret = T(l->text) + l->dle;
|
||||
char *ret;
|
||||
|
||||
if ( l->dle < 0 || l->dle >= S(l->text) )
|
||||
return 0;
|
||||
|
||||
ret = T(l->text) + l->dle;
|
||||
|
||||
return ret[0] ? ret : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user