1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
From: Per Andersson <avtobiff@gmail.com>
Date: Sat, 9 Jun 2012 00:48:17 +0200
Subject: Format error strings safely.
---
ext/rubymain.cpp | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ext/rubymain.cpp b/ext/rubymain.cpp
index e6b39e4..53510b5 100644
--- a/ext/rubymain.cpp
+++ b/ext/rubymain.cpp
@@ -499,7 +499,7 @@ static VALUE t_connect_server (VALUE self, VALUE server, VALUE port)
rb_raise (EM_eConnectionError, "no connection");
return ULONG2NUM (f);
} catch (std::runtime_error e) {
- rb_raise (EM_eConnectionError, e.what());
+ rb_raise (EM_eConnectionError, "%s", e.what());
}
return Qnil;
}
@@ -520,7 +520,7 @@ static VALUE t_bind_connect_server (VALUE self, VALUE bind_addr, VALUE bind_port
rb_raise (EM_eConnectionError, "no connection");
return ULONG2NUM (f);
} catch (std::runtime_error e) {
- rb_raise (EM_eConnectionError, e.what());
+ rb_raise (EM_eConnectionError, "%s", e.what());
}
return Qnil;
}
@@ -805,7 +805,7 @@ static VALUE t_watch_filename (VALUE self, VALUE fname)
try {
return ULONG2NUM(evma_watch_filename(StringValuePtr(fname)));
} catch (std::runtime_error e) {
- rb_raise (EM_eUnsupported, e.what());
+ rb_raise (EM_eUnsupported, "%s", e.what());
}
return Qnil;
}
@@ -831,7 +831,7 @@ static VALUE t_watch_pid (VALUE self, VALUE pid)
try {
return ULONG2NUM(evma_watch_pid(NUM2INT(pid)));
} catch (std::runtime_error e) {
- rb_raise (EM_eUnsupported, e.what());
+ rb_raise (EM_eUnsupported, "%s", e.what());
}
return Qnil;
}
--
|