static void params_free(char **params)
{
int i;
+
for (i=0; i < PARAMS_MAX; i++)
- free(params[i]);
+ if (params[i] != NULL)
+ free(params[i]);
}
void process_cmd(char *cmdline, int clinep, mwdata_t *mwdata)
{
unsigned char mdata[32];
- unsigned int intopt;
+ unsigned int intopt=0;
char cmd[128], pbuf[128], *params[PARAMS_MAX];
int i, pcnt;
char *inbuf = cmdline;
pcnt = 0;
if (strncmp(cmd, "quit", 4) == 0) {
- //close(mw_fd);
- //exit(0);
/* just in case we quit and show another screen */
mw_update_display(&mwdata->mwdevice, MW_SCREEN_MODE_IDLE, 0);
- params_free(params);
+ // params_free(params);
g_main_loop_quit (mwdata->mloop);
}
if (strncmp(cmd, "help", 4) == 0) {
if (clr == MW_TRANSPARENT)
return;
+ if (x < 0 || x > 128 || y < 0 || y > 128)
+ return;
+
*(unsigned char *)(mwbuf->pbuf+((y*mwbuf->res_x)+x)) = clr;
}