[Fix] Another possible segfault with isspace().
This commit is contained in:
parent
a77942e9a4
commit
71f4ce95d2
@ -13,6 +13,7 @@
|
|||||||
#include "ldata.h"
|
#include "ldata.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "music.h"
|
#include "music.h"
|
||||||
|
#include "lstd.h"
|
||||||
#include "intro.h"
|
#include "intro.h"
|
||||||
|
|
||||||
#define INTRO_FONT_SIZE 18. /**< Intro text font size. */
|
#define INTRO_FONT_SIZE 18. /**< Intro text font size. */
|
||||||
@ -129,9 +130,10 @@ int intro_display(void) {
|
|||||||
/* Skip the boring intro we saw a million times already! */
|
/* Skip the boring intro we saw a million times already! */
|
||||||
if(event.key.keysym.sym == SDLK_ESCAPE)
|
if(event.key.keysym.sym == SDLK_ESCAPE)
|
||||||
offset = max * (intro_font.h + 5.);
|
offset = max * (intro_font.h + 5.);
|
||||||
else if(!isspace(event.key.keysym.sym))
|
/* Only handle space from here down. */
|
||||||
|
else if(!lstd_isspace(event.key.keysym.sym))
|
||||||
break;
|
break;
|
||||||
/* Purpose fallthrough. */
|
/* Purpose fallthrough. */
|
||||||
case SDL_JOYBUTTONDOWN:
|
case SDL_JOYBUTTONDOWN:
|
||||||
offset += 250.;
|
offset += 250.;
|
||||||
default:
|
default:
|
||||||
|
@ -21,3 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
#define lstd_iscntrl(k) (lstd_checkascii(k) ? iscntrl(k) : 0)
|
#define lstd_iscntrl(k) (lstd_checkascii(k) ? iscntrl(k) : 0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check to see if a key is a space character.
|
||||||
|
*/
|
||||||
|
#define lstd_isspace(k) (lstd_checkascii(k) ? isspace(k) : 0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user