[Fix] Another possible segfault with isspace().

This commit is contained in:
Allanis 2014-05-28 21:32:48 +01:00
parent a77942e9a4
commit 71f4ce95d2
2 changed files with 9 additions and 2 deletions

View File

@ -13,6 +13,7 @@
#include "ldata.h"
#include "font.h"
#include "music.h"
#include "lstd.h"
#include "intro.h"
#define INTRO_FONT_SIZE 18. /**< Intro text font size. */
@ -129,7 +130,8 @@ int intro_display(void) {
/* Skip the boring intro we saw a million times already! */
if(event.key.keysym.sym == SDLK_ESCAPE)
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;
/* Purpose fallthrough. */
case SDL_JOYBUTTONDOWN:

View File

@ -21,3 +21,8 @@
*/
#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)