summaryrefslogtreecommitdiff
path: root/src/plugins/guile
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2018-04-10 21:26:15 +0200
committerSébastien Helleu <flashcode@flashtux.org>2018-04-10 21:26:15 +0200
commit3467d6eb430d132ff94e04ad7485d8f705317099 (patch)
treebcf6a9684d2f08c41e50ec95963be55ddb53144a /src/plugins/guile
parent9a969c41dbd938f598fd06f2dee8bbd3feafea57 (diff)
downloadweechat-3467d6eb430d132ff94e04ad7485d8f705317099.zip
scripts: return long integer instead of string in function infolist_time
Diffstat (limited to 'src/plugins/guile')
-rw-r--r--src/plugins/guile/weechat-guile-api.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c
index a0a7450b9..90af55799 100644
--- a/src/plugins/guile/weechat-guile-api.c
+++ b/src/plugins/guile/weechat-guile-api.c
@@ -4284,27 +4284,16 @@ weechat_guile_api_infolist_pointer (SCM infolist, SCM variable)
SCM
weechat_guile_api_infolist_time (SCM infolist, SCM variable)
{
- char timebuffer[64], *result;
time_t time;
- struct tm *date_tmp;
- SCM return_value;
- API_INIT_FUNC(1, "infolist_time", API_RETURN_EMPTY);
+ API_INIT_FUNC(1, "infolist_time", API_RETURN_LONG(0));
if (!scm_is_string (infolist) || !scm_is_string (variable))
- API_WRONG_ARGS(API_RETURN_EMPTY);
+ API_WRONG_ARGS(API_RETURN_LONG(0));
- timebuffer[0] = '\0';
time = weechat_infolist_time (API_STR2PTR(API_SCM_TO_STRING(infolist)),
API_SCM_TO_STRING(variable));
- date_tmp = localtime (&time);
- if (date_tmp)
- {
- if (strftime (timebuffer, sizeof (timebuffer), "%F %T", date_tmp) == 0)
- timebuffer[0] = '\0';
- }
- result = strdup (timebuffer);
- API_RETURN_STRING_FREE(result);
+ API_RETURN_LONG(time);
}
SCM