summaryrefslogtreecommitdiff
path: root/src/plugins/tcl
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-03-01 09:06:18 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-03-01 09:06:18 +0100
commit5a7059751635abacc0ede10fdedfa1d45c73143e (patch)
tree18f7f90925c53855390ece88d2839ae1e45fb15e /src/plugins/tcl
parent3cd02595755a94dde73c2c358fb9a8c035be41bc (diff)
downloadweechat-5a7059751635abacc0ede10fdedfa1d45c73143e.zip
scripts: fix type of value returned by function hdata_time (from string to long integer) in perl/ruby/lua/tcl/guile plugins
Diffstat (limited to 'src/plugins/tcl')
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index 421847a48..542474d04 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -5014,25 +5014,22 @@ API_FUNC(hdata_time)
{
Tcl_Obj *objp;
time_t time;
- char timebuffer[64], *result, *hdata, *pointer, *name;
+ char *hdata, *pointer, *name;
int i;
- API_INIT_FUNC(1, "hdata_time", API_RETURN_EMPTY);
+ API_INIT_FUNC(1, "hdata_time", API_RETURN_LONG(0));
if (objc < 4)
- API_WRONG_ARGS(API_RETURN_EMPTY);
+ API_WRONG_ARGS(API_RETURN_LONG(0));
hdata = Tcl_GetStringFromObj (objv[1], &i);
pointer = Tcl_GetStringFromObj (objv[2], &i);
name = Tcl_GetStringFromObj (objv[3], &i);
- timebuffer[0] = '\0';
time = weechat_hdata_time (API_STR2PTR(hdata),
API_STR2PTR(pointer),
name);
- snprintf (timebuffer, sizeof (timebuffer), "%ld", (long int)time);
- result = strdup (timebuffer);
- API_RETURN_STRING_FREE(result);
+ API_RETURN_LONG(time);
}
API_FUNC(hdata_hashtable)