oga_gfx: strlcpy, msg max len 128 + style nits
This commit is contained in:
parent
2a3000793b
commit
15708f5d44
|
@ -103,7 +103,7 @@ typedef struct oga_video
|
||||||
void *font;
|
void *font;
|
||||||
int msg_width;
|
int msg_width;
|
||||||
int msg_height;
|
int msg_height;
|
||||||
char last_msg[1024];
|
char last_msg[128];
|
||||||
|
|
||||||
int bpp;
|
int bpp;
|
||||||
} oga_video_t;
|
} 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)
|
if (strcmp(msg, vid->last_msg) == 0)
|
||||||
return true;
|
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);
|
rga_clear_surface(vid->msg_surface, 0);
|
||||||
|
|
||||||
atlas = vid->font_driver->get_atlas(vid->font);
|
atlas = vid->font_driver->get_atlas(vid->font);
|
||||||
|
|
Loading…
Reference in New Issue