Skip to content

Commit

Permalink
fix IS_PRINT so that we really do only allow input in characters we c…
Browse files Browse the repository at this point in the history
…an display
  • Loading branch information
ttlanhil committed Apr 10, 2007
1 parent 3f702b8 commit 785daac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions asc.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ extern "C" {

/*!
* Check if a character is printable. In this context, that means
* printable ascii, or non-ascii if it's not a color code
* printable ascii, or non-ascii if we know what symbol to use
*/
#define IS_PRINT(c) (((c) >= 32 && (c) <= 126) || ((c) >= SPECIALCHAR_LBOUND && (c) <= SPECIALCHAR_UBOUND))
#define IS_PRINT(c) (get_font_char(c) >= 0)

/*!
* A macro for the my_xmlstrncopy function that copies and converts an xml-string. Sets the length to 0, hence it will copy untill \\0 is reached.
Expand Down
1 change: 0 additions & 1 deletion font.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ int chat_font=0;
int name_font=0;
int book_font=0;

int get_font_char(unsigned char cur_char);
int get_font_width(int cur_char);
int get_nstring_width(const unsigned char *str, int len);
int set_font_parameters (int num);
Expand Down
2 changes: 2 additions & 0 deletions font.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ void reload_fonts();

void cleanup_fonts(void);

int get_font_char(unsigned char cur_char);

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down

0 comments on commit 785daac

Please sign in to comment.