OSDN Git Service
(root)
/
hengband
/
hengband.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2372bf6
)
・ケ・ッ・遙シ・タ・ラコ鋿ョテ讀ヒ・ミ・テ・ユ・。・ェ。シ・ミ。シ、ャオッ、ウ、鬢ハ、、、隍ヲ、ヒス、タオ。」
author
habu
<habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 25 Jan 2002 17:48:22 +0000
(17:48 +0000)
committer
habu
<habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 25 Jan 2002 17:48:22 +0000
(17:48 +0000)
src/cmd4.c
patch
|
blob
|
history
diff --git
a/src/cmd4.c
b/src/cmd4.c
index
5545a05
..
60a38c2
100644
(file)
--- a/
src/cmd4.c
+++ b/
src/cmd4.c
@@
-5027,6
+5027,7
@@
static void do_cmd_knowledge_inven(void)
/*
* Make screen dump to buffer
*/
+#define SCREEN_BUF_SIZE 65536
cptr make_screen_dump(void)
{
int y, x, i;
@@
-5037,7
+5038,7
@@
cptr make_screen_dump(void)
FILE *fff;
char file_name[1024];
char buf[4096];
- char screen_buf[
65536
];
+ char screen_buf[
SCREEN_BUF_SIZE
];
char *html_head[] = {
"<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
@@
-5124,6
+5125,11
@@
cptr make_screen_dump(void)
while (fgets(buf, 4096, fff))
{
+ if (strlen(screen_buf) + strlen(buf) + 1 > SCREEN_BUF_SIZE)
+ {
+ /* Too big screen dump size */
+ return (NULL);
+ }
strcat(screen_buf, buf);
}