add: a security on print: if no line print return err
This commit is contained in:
parent
7c73c27e75
commit
5815adc7d6
@ -1,4 +1,9 @@
|
|||||||
cmd_print(text, args)
|
cmd_print(text, args)
|
||||||
{
|
{
|
||||||
|
if ([text + LOCATION_LENGTH] == 0)
|
||||||
|
{
|
||||||
|
putstr("Empty file\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
putstr([[text + LOCATION_ARRAY] + [text + LOCATION_CURRENT_LINE]]);
|
putstr([[text + LOCATION_ARRAY] + [text + LOCATION_CURRENT_LINE]]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user