summaryrefslogtreecommitdiffstats
path: root/rogue/rogue.h
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2007-12-27 23:52:59 +0000
committerdholland <dholland@NetBSD.org>2007-12-27 23:52:59 +0000
commit1c987590202c8ca8dec65a88afd1d73328d55b39 (patch)
tree4b66e49e6975dce09a7ef0d62daa823e8bdabbf5 /rogue/rogue.h
parent7bdfc68392299315f4249ce06cfac7b13fb0514a (diff)
downloadbsdgames-darwin-1c987590202c8ca8dec65a88afd1d73328d55b39.tar.gz
bsdgames-darwin-1c987590202c8ca8dec65a88afd1d73328d55b39.tar.zst
bsdgames-darwin-1c987590202c8ca8dec65a88afd1d73328d55b39.zip
Comprehensive (or at least extensive) string handling cleanup for rogue.
This patch dates (mostly) back to 2002; the critical parts of it were handled back then by security-officer. As far as I know, there's nothing exploitable fixed herein. A slightly earlier version of this patch was reviewed by Christian Biere when I filed it as PR 34750.
Diffstat (limited to 'rogue/rogue.h')
-rw-r--r--rogue/rogue.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/rogue/rogue.h b/rogue/rogue.h
index d8a60966..64747981 100644
--- a/rogue/rogue.h
+++ b/rogue/rogue.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rogue.h,v 1.17 2005/02/15 12:54:50 jsm Exp $ */
+/* $NetBSD: rogue.h,v 1.18 2007/12/27 23:53:00 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -515,14 +515,14 @@ void freeze(object *);
int get_armor_class(const object *);
int get_com_id(int *, short);
int get_damage(const char *, boolean);
-void get_desc(const object *, char *);
+void get_desc(const object *, char *, size_t);
int get_dir(short, short, short, short);
void get_dir_rc(short, short *, short *, short);
char get_dungeon_char(short, short);
int get_exp_level(long);
void get_food(object *, boolean);
int get_hit_chance(const object *);
-int get_input_line(const char *, const char *, char *, const char *, boolean, boolean);
+int get_input_line(const char *, const char *, char *, size_t, const char *, boolean, boolean);
char get_mask_char(unsigned short);
int get_number(const char *);
boolean get_oth_room(short, short *, short *);
@@ -597,7 +597,9 @@ void md_lock(boolean);
void md_shell(const char *);
void md_sleep(int);
void md_slurp(void);
-void message(const char *, boolean);
+/*void message(const char *, boolean);*/
+void messagef(boolean, const char *, ...)
+ __attribute__((__format__(__printf__, 2, 3)));
void mix_colors(void);
void mix_random_rooms(void);
int mon_can_go(const object *, int, int);
@@ -759,7 +761,8 @@ extern boolean see_invisible;
extern boolean sustain_strength;
extern boolean trap_door;
extern boolean wizard;
-extern char hit_message[];
+#define HIT_MESSAGE_SIZE 80
+extern char hit_message[HIT_MESSAGE_SIZE];
#define HUNGER_STR_LEN 8
extern char hunger_str[HUNGER_STR_LEN];
extern char login_name[MAX_OPT_LEN];