1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00

scripts: fix type of value returned by function hdata_time (from string to long integer) in perl/ruby/lua/tcl/guile plugins

This commit is contained in:
Sébastien Helleu
2015-03-01 09:06:18 +01:00
parent 3cd0259575
commit 5a70597516
6 changed files with 21 additions and 40 deletions
+4 -8
View File
@@ -5691,13 +5691,12 @@ static VALUE
weechat_ruby_api_hdata_time (VALUE class, VALUE hdata, VALUE pointer,
VALUE name)
{
char *c_hdata, *c_pointer, *c_name, timebuffer[64], *result;
char *c_hdata, *c_pointer, *c_name;
time_t time;
VALUE return_value;
API_INIT_FUNC(1, "hdata_time", API_RETURN_EMPTY);
API_INIT_FUNC(1, "hdata_time", API_RETURN_LONG(0));
if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name))
API_WRONG_ARGS(API_RETURN_EMPTY);
API_WRONG_ARGS(API_RETURN_LONG(0));
Check_Type (hdata, T_STRING);
Check_Type (pointer, T_STRING);
@@ -5707,14 +5706,11 @@ weechat_ruby_api_hdata_time (VALUE class, VALUE hdata, VALUE pointer,
c_pointer = StringValuePtr (pointer);
c_name = StringValuePtr (name);
timebuffer[0] = '\0';
time = weechat_hdata_time (API_STR2PTR(c_hdata),
API_STR2PTR(c_pointer),
c_name);
snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)time);
result = strdup (timebuffer);
API_RETURN_STRING_FREE(result);
API_RETURN_LONG(time);
}
static VALUE