summaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-22 08:53:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-22 08:53:34 +0000
commit2fed885b253b553592b05ab40a3f009dfcea0a41 (patch)
tree4515bfaba327031545daeba38c244f3b5519cca2 /process.c
parente8a03f98f83d0592edae30e58c365cdcdf84f3ad (diff)
downloadruby-2fed885b253b553592b05ab40a3f009dfcea0a41.tar.gz
ruby-2fed885b253b553592b05ab40a3f009dfcea0a41.tar.xz
ruby-2fed885b253b553592b05ab40a3f009dfcea0a41.zip
* compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),
iseq.c (ruby_iseq_disasm_insn, ruby_iseq_disasm), process.c (pst_message), re.c (match_inspect): use rb_str_catf. * dir.c (dir_inspect), iseq.c (iseq_inspect, insn_operand_intern): use rb_sprintf. * error.c (rb_name_error, rb_raise, rb_loaderror, rb_fatal): use rb_vsprintf. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/process.c b/process.c
index 6e757338c..91c1fca71 100644
--- a/process.c
+++ b/process.c
@@ -278,33 +278,29 @@ static void
pst_message(VALUE str, rb_pid_t pid, int status)
{
char buf[256];
- snprintf(buf, sizeof(buf), "pid %ld", (long)pid);
- rb_str_cat2(str, buf);
+ rb_str_catf(str, "pid %ld", (long)pid);
if (WIFSTOPPED(status)) {
int stopsig = WSTOPSIG(status);
const char *signame = ruby_signal_name(stopsig);
if (signame) {
- snprintf(buf, sizeof(buf), " stopped SIG%s (signal %d)", signame, stopsig);
+ rb_str_catf(str, " stopped SIG%s (signal %d)", signame, stopsig);
}
else {
- snprintf(buf, sizeof(buf), " stopped signal %d", stopsig);
+ rb_str_catf(str, " stopped signal %d", stopsig);
}
- rb_str_cat2(str, buf);
}
if (WIFSIGNALED(status)) {
int termsig = WTERMSIG(status);
const char *signame = ruby_signal_name(termsig);
if (signame) {
- snprintf(buf, sizeof(buf), " SIG%s (signal %d)", signame, termsig);
+ rb_str_catf(str, " SIG%s (signal %d)", signame, termsig);
}
else {
- snprintf(buf, sizeof(buf), " signal %d", termsig);
+ rb_str_catf(str, " signal %d", termsig);
}
- rb_str_cat2(str, buf);
}
if (WIFEXITED(status)) {
- snprintf(buf, sizeof(buf), " exit %d", WEXITSTATUS(status));
- rb_str_cat2(str, buf);
+ rb_str_catf(str, " exit %d", WEXITSTATUS(status));
}
#ifdef WCOREDUMP
if (WCOREDUMP(status)) {