plugins: view-text, zxbox: fix panic when called without parameter

Change-Id: Ife654e6dcb29916f661ce0c2232f4060ac02f5d2
This commit is contained in:
Christian Soffke 2025-12-22 05:53:48 +01:00
parent a2e63fca59
commit f316535684
2 changed files with 9 additions and 4 deletions

View file

@ -28,6 +28,8 @@
/* this is the plugin entry point */
enum plugin_status plugin_start(const void* parameter)
{
if (!parameter)
return PLUGIN_ERROR;
char** title_and_text = (char**)parameter;
view_text(title_and_text[0], title_and_text[1]);

View file

@ -57,6 +57,9 @@ long start_time IBSS_ATTR = 0;
enum plugin_status plugin_start(const void* parameter)
{
if (!parameter)
return PLUGIN_ERROR;
#if LCD_DEPTH > 1
rb->lcd_set_backdrop(NULL);
#endif
@ -211,7 +214,7 @@ void spkb_process_events( int evenframe )
ki = KS_TO_KEY(intkeys[3]);
spkb_kbstate[ki].state = 0;
}
if ( buttons & ZX_LEFT ){
ki = KS_TO_KEY(intkeys[2]);
spkb_kbstate[ki].state = 1;
@ -220,7 +223,7 @@ void spkb_process_events( int evenframe )
ki = KS_TO_KEY(intkeys[2]);
spkb_kbstate[ki].state = 0;
}
if ( buttons & ZX_UP ){
ki = KS_TO_KEY(intkeys[0]);
spkb_kbstate[ki].state = 1;
@ -229,7 +232,7 @@ void spkb_process_events( int evenframe )
ki = KS_TO_KEY(intkeys[0]);
spkb_kbstate[ki].state = 0;
}
if ( buttons & ZX_DOWN ){
ki = KS_TO_KEY(intkeys[1]);
spkb_kbstate[ki].state = 1;
@ -238,7 +241,7 @@ void spkb_process_events( int evenframe )
ki = KS_TO_KEY(intkeys[1]);
spkb_kbstate[ki].state = 0;
}
if ( buttons & ZX_SELECT ){
ki = KS_TO_KEY(intkeys[4]);
spkb_kbstate[ki].state = 1;