add: a security on print: if no line print return err

This commit is contained in:
starnakin 2023-07-26 09:58:35 +02:00
parent 7c73c27e75
commit 5815adc7d6

View File

@ -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]]);
} }