oga_gfx: strlcpy, msg max len 128 + style nits

This commit is contained in:
valadaa48 2020-09-19 11:16:30 -04:00
parent 2a3000793b
commit 15708f5d44

View File

@ -103,7 +103,7 @@ typedef struct oga_video
void *font;
int msg_width;
int msg_height;
char last_msg[1024];
char last_msg[128];
int bpp;
} oga_video_t;
@ -468,7 +468,7 @@ static bool render_msg(oga_video_t* vid, const char* msg)
if (strcmp(msg, vid->last_msg) == 0)
return true;
strncpy(vid->last_msg, c, sizeof(vid->last_msg)-1);
strlcpy(vid->last_msg, c, sizeof(vid->last_msg));
rga_clear_surface(vid->msg_surface, 0);
atlas = vid->font_driver->get_atlas(vid->font);