summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-08-10 05:41:28 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-08-10 05:41:28 +0000
commite3e0fede44721372b6bcd62eb20f199dfc647076 (patch)
treedd43fc1480362bd8beb6e65d3b0261b52dabeeb4 /eval.c
parent2562004338bc2694a7d8da75f4effcb9aa889641 (diff)
1.1c2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index 776cb98f0c..9e30dc3b99 100644
--- a/eval.c
+++ b/eval.c
@@ -3748,11 +3748,11 @@ backtrace(lev)
ary = ary_new();
if (lev < 0) {
if (frame->last_func) {
- sprintf(buf, "%s:%d:in `%s'", sourcefile, sourceline,
+ snprintf(buf, BUFSIZ, "%s:%d:in `%s'", sourcefile, sourceline,
rb_id2name(frame->last_func));
}
else {
- sprintf(buf, "%s:%d", sourcefile, sourceline);
+ snprintf(buf, BUFSIZ, "%s:%d", sourcefile, sourceline);
}
ary_push(ary, str_new2(buf));
}
@@ -3764,12 +3764,12 @@ backtrace(lev)
}
while (frame && frame->file) {
if (frame->prev && frame->prev->last_func) {
- sprintf(buf, "%s:%d:in `%s'",
+ snprintf(buf, BUFSIZ, "%s:%d:in `%s'",
frame->file, frame->line,
rb_id2name(frame->prev->last_func));
}
else {
- sprintf(buf, "%s:%d", frame->file, frame->line);
+ snprintf(buf, BUFSIZ, "%s:%d", frame->file, frame->line);
}
ary_push(ary, str_new2(buf));
frame = frame->prev;