kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
September 2019
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
24 participants
369 discussions
Start a n
N
ew thread
git:master:f58c3ce7: tools: add reply_route support to route_graph.py tool
by Henning Westerholt
20 Sep '19
20 Sep '19
Module: kamailio Branch: master Commit: f58c3ce7050908606e7bfd4dcde7f47622c0473e URL:
https://github.com/kamailio/kamailio/commit/f58c3ce7050908606e7bfd4dcde7f47…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-20T12:53:10+02:00 tools: add reply_route support to route_graph.py tool --- Modified: misc/tools/route_graph/route_graph.py --- Diff:
https://github.com/kamailio/kamailio/commit/f58c3ce7050908606e7bfd4dcde7f47…
Patch:
https://github.com/kamailio/kamailio/commit/f58c3ce7050908606e7bfd4dcde7f47…
--- diff --git a/misc/tools/route_graph/route_graph.py b/misc/tools/route_graph/route_graph.py index b416bdc186..f5633c92fd 100755 --- a/misc/tools/route_graph/route_graph.py +++ b/misc/tools/route_graph/route_graph.py @@ -37,6 +37,7 @@ routes = {} f_routes = {} b_routes = {} +or_routes = {} r_routes = {} s_routes = {} e_routes = {} @@ -104,9 +105,13 @@ def traverse_routes(_level, _name): if rname is None: rname = "failure" elif rtype == "onreply_": - rt = r_routes + rt = or_routes if rname is None: rname = "onreply" + elif rtype == "reply_": + rt = r_routes + if rname is None: + rname = "reply" elif rtype == "onsend_": rt = s_routes if rname is None: @@ -130,8 +135,11 @@ def traverse_routes(_level, _name): rt = f_routes rname = "failure" elif rtype == "onreply_": - rt = r_routes + rt = or_routes rname = "onreply" + elif rtype == "reply_": + rt = r_routes + rname = "reply" elif rtype == "onsend_": rt = s_routes rname = "onsend" @@ -151,7 +159,8 @@ def traverse_routes(_level, _name): log("routes: %s" % (routes)) log("branch_routes: %s" % (b_routes)) log("failure_routes: %s" % (f_routes)) -log("onreply_routes: %s" % (r_routes)) +log("onreply_routes: %s" % (or_routes)) +log("reply_routes: %s" % (r_routes)) log("onsend_routes: %s" % (s_routes)) log("event_routes: %s" % (e_routes)) @@ -193,8 +202,15 @@ def traverse_routes(_level, _name): for r in f_routes[fr]: traverse_routes(1, r) -if len(r_routes) > 0: +if len(or_routes) > 0: print "\nOnreply routes\n--------------" + for onr in or_routes.keys(): + print "\n%s" % (onr) + for r in or_routes[onr]: + traverse_routes(1, r) + +if len(r_routes) > 0: + print "\nReply routes\n--------------" for onr in r_routes.keys(): print "\n%s" % (onr) for r in r_routes[onr]:
1
0
0
0
git:master:dc2acb89: core: replace glibc time function calls with the thread-safe versions
by Henning Westerholt
20 Sep '19
20 Sep '19
Module: kamailio Branch: master Commit: dc2acb895538131e99c770da6f7448cb5a46fc32 URL:
https://github.com/kamailio/kamailio/commit/dc2acb895538131e99c770da6f7448c…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-19T23:49:32+02:00 core: replace glibc time function calls with the thread-safe versions - replace glibc time function calls with the thread-safe versions, to prevent race conditions from multi-process / multi-threaded access - used in 'kamcmd core.uptime' rpc cmd, no functional change, locally tested --- Modified: src/core/core_cmd.c --- Diff:
https://github.com/kamailio/kamailio/commit/dc2acb895538131e99c770da6f7448c…
Patch:
https://github.com/kamailio/kamailio/commit/dc2acb895538131e99c770da6f7448c…
--- diff --git a/src/core/core_cmd.c b/src/core/core_cmd.c index 5b1c4624ed..717e240fde 100644 --- a/src/core/core_cmd.c +++ b/src/core/core_cmd.c @@ -224,8 +224,7 @@ static const char* dst_blst_stats_get_doc[] = { #endif - -#define MAX_CTIME_LEN 128 +#define MAX_CTIME_LEN 25 /* up time */ static char up_since_ctime[MAX_CTIME_LEN]; @@ -381,13 +380,14 @@ static void core_uptime(rpc_t* rpc, void* c) { void* s; time_t now; + char buf[MAX_CTIME_LEN]; str snow; + snow.s = buf; time(&now); if (rpc->add(c, "{", &s) < 0) return; - snow.s = ctime(&now); - if(snow.s) { + if(ctime_r(&now, snow.s)) { snow.len = strlen(snow.s); if(snow.len>2 && snow.s[snow.len-1]=='\n') snow.len--; rpc->struct_add(s, "S", "now", &snow); @@ -1187,21 +1187,14 @@ int register_core_rpcs(void) int rpc_init_time(void) { - char *t; - t=ctime(&up_since); - if (strlen(t)+1>=MAX_CTIME_LEN) { - ERR("Too long data %d\n", (int)strlen(t)); + char t[MAX_CTIME_LEN]; + int len; + if (! ctime_r(&up_since, t)) { + ERR("Invalid time value\n"); return -1; } strcpy(up_since_ctime, t); - t = up_since_ctime + strlen(up_since_ctime); - while(t>up_since_ctime) { - if(*t=='\0' || *t=='\r' || *t=='\n') { - *t = '\0'; - } else { - break; - } - t--; - } + len = strlen(up_since_ctime); + if(len>2 && up_since_ctime[len-1]=='\n') up_since_ctime[len-1]='\0'; return 0; }
2
3
0
0
git:master:4a66e500: tools: fix python exception usage in route_graph.py tool
by Henning Westerholt
20 Sep '19
20 Sep '19
Module: kamailio Branch: master Commit: 4a66e500ddb6028d3dfcf67aca951282309b6ea4 URL:
https://github.com/kamailio/kamailio/commit/4a66e500ddb6028d3dfcf67aca95128…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-20T12:02:03+02:00 tools: fix python exception usage in route_graph.py tool --- Modified: misc/tools/route_graph/route_graph.py --- Diff:
https://github.com/kamailio/kamailio/commit/4a66e500ddb6028d3dfcf67aca95128…
Patch:
https://github.com/kamailio/kamailio/commit/4a66e500ddb6028d3dfcf67aca95128…
--- diff --git a/misc/tools/route_graph/route_graph.py b/misc/tools/route_graph/route_graph.py index 135440a3c5..b416bdc186 100755 --- a/misc/tools/route_graph/route_graph.py +++ b/misc/tools/route_graph/route_graph.py @@ -75,12 +75,12 @@ def traverse_routes(_level, _name): if len(sys.argv) < 2: - raise "usage: %s configuration-file [max_depth]" % sys.argv[0] + raise Exception('wrong number of arguments\nusage: ' + sys.argv[0] + ' configuration-file [max_depth]') if len(sys.argv) == 3: max_depth = int(sys.argv[2]) cfg = file(sys.argv[1], "r") if cfg is None: - raise "Missing config file" + raise Exception ('Missing config file') line = cfg.readline() rt = routes while line:
1
0
0
0
git:master:545ef519: tools: use correct check of None instead of wrong comparison in route_graph.py tool
by Henning Westerholt
20 Sep '19
20 Sep '19
Module: kamailio Branch: master Commit: 545ef51912ae9bf5e14eaffeb9f41be8359a442f URL:
https://github.com/kamailio/kamailio/commit/545ef51912ae9bf5e14eaffeb9f41be…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-20T11:54:16+02:00 tools: use correct check of None instead of wrong comparison in route_graph.py tool --- Modified: misc/tools/route_graph/route_graph.py --- Diff:
https://github.com/kamailio/kamailio/commit/545ef51912ae9bf5e14eaffeb9f41be…
Patch:
https://github.com/kamailio/kamailio/commit/545ef51912ae9bf5e14eaffeb9f41be…
--- diff --git a/misc/tools/route_graph/route_graph.py b/misc/tools/route_graph/route_graph.py index 2024cf42a0..135440a3c5 100755 --- a/misc/tools/route_graph/route_graph.py +++ b/misc/tools/route_graph/route_graph.py @@ -79,7 +79,7 @@ def traverse_routes(_level, _name): if len(sys.argv) == 3: max_depth = int(sys.argv[2]) cfg = file(sys.argv[1], "r") -if cfg == None: +if cfg is None: raise "Missing config file" line = cfg.readline() rt = routes @@ -90,40 +90,40 @@ def traverse_routes(_level, _name): main_match = re_main_route.search(line) def_match = re_def_route.search(line) call_match = re_call_route.search(line) - if not call_match == None: + if not call_match is None: log("CALL: " + line) name = call_match.group(2) log(rname +":"+name) rt[rname].append(name) - elif not def_match == None: + elif not def_match is None: log("DEF: " + line) rtype = def_match.group(1) rname = def_match.group(3) if rtype == "failure_": rt = f_routes - if rname == None: + if rname is None: rname = "failure" elif rtype == "onreply_": rt = r_routes - if rname == None: + if rname is None: rname = "onreply" elif rtype == "onsend_": rt = s_routes - if rname == None: + if rname is None: rname = "onsend" elif rtype == "branch_": rt = b_routes - if rname == None: + if rname is None: rname = "branch" elif rtype == "event_": rt = e_routes - if rname == None: + if rname is None: rname = "event" else: rt = routes log(rname) rt[rname] = [] - elif not main_match == None: + elif not main_match is None: log("MAIN: " + line) rtype = main_match.group(1) if rtype == "failure_":
1
0
0
0
git:master:4c709004: core: fix out of bounds write, related to commits 776d0d6bb1086 and dc2acb895538
by Henning Westerholt
20 Sep '19
20 Sep '19
Module: kamailio Branch: master Commit: 4c709004bcc6a90fee21cf39fa1b19b0d69afec0 URL:
https://github.com/kamailio/kamailio/commit/4c709004bcc6a90fee21cf39fa1b19b…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-20T11:31:50+02:00 core: fix out of bounds write, related to commits 776d0d6bb1086 and dc2acb895538 --- Modified: src/core/core_cmd.c Modified: src/core/select_core.c --- Diff:
https://github.com/kamailio/kamailio/commit/4c709004bcc6a90fee21cf39fa1b19b…
Patch:
https://github.com/kamailio/kamailio/commit/4c709004bcc6a90fee21cf39fa1b19b…
--- diff --git a/src/core/core_cmd.c b/src/core/core_cmd.c index 717e240fde..6a32b2f932 100644 --- a/src/core/core_cmd.c +++ b/src/core/core_cmd.c @@ -224,7 +224,7 @@ static const char* dst_blst_stats_get_doc[] = { #endif -#define MAX_CTIME_LEN 25 +#define MAX_CTIME_LEN 26 /* up time */ static char up_since_ctime[MAX_CTIME_LEN]; diff --git a/src/core/select_core.c b/src/core/select_core.c index 6190c8b875..029f880a48 100644 --- a/src/core/select_core.c +++ b/src/core/select_core.c @@ -1565,7 +1565,7 @@ int select_sys_now_fmt(str* res, select_t* s, struct sip_msg* msg) return -1; } if (s->n <= SEL_POS+1) { - char buff[25]; + char buff[26]; if (! asctime_r(&tm, buff)) { ERR("Invalid time value\n"); return -1;
1
0
0
0
git:master:b2c3344f: core: remove unnecessary negative check for unsigned int value (code scan warning)
by Henning Westerholt
20 Sep '19
20 Sep '19
Module: kamailio Branch: master Commit: b2c3344fb2ed55ef9da5594046b7eb92bc479517 URL:
https://github.com/kamailio/kamailio/commit/b2c3344fb2ed55ef9da5594046b7eb9…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-20T10:16:32+02:00 core: remove unnecessary negative check for unsigned int value (code scan warning) --- Modified: src/core/flags.c --- Diff:
https://github.com/kamailio/kamailio/commit/b2c3344fb2ed55ef9da5594046b7eb9…
Patch:
https://github.com/kamailio/kamailio/commit/b2c3344fb2ed55ef9da5594046b7eb9…
--- diff --git a/src/core/flags.c b/src/core/flags.c index 589421ce7b..551eefe2ee 100644 --- a/src/core/flags.c +++ b/src/core/flags.c @@ -66,10 +66,6 @@ int flag_in_range( flag_t flag ) { LM_ERR("message flag %d too high; MAX=%d\n", flag, MAX_FLAG ); return 0; } - if ((int)flag<0) { - LM_ERR("message flag (%d) must be in range 0..%d\n", flag, MAX_FLAG ); - return 0; - } return 1; }
1
0
0
0
git:master:0e6b79f2: core: comment added to timer fork logic
by Henning Westerholt
19 Sep '19
19 Sep '19
Module: kamailio Branch: master Commit: 0e6b79f293e05222230f4e72efe1b5667253af48 URL:
https://github.com/kamailio/kamailio/commit/0e6b79f293e05222230f4e72efe1b56…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-20T00:03:55+02:00 core: comment added to timer fork logic --- Modified: src/main.c --- Diff:
https://github.com/kamailio/kamailio/commit/0e6b79f293e05222230f4e72efe1b56…
Patch:
https://github.com/kamailio/kamailio/commit/0e6b79f293e05222230f4e72efe1b56…
--- diff --git a/src/main.c b/src/main.c index 03d39b46d4..9b82cbca68 100644 --- a/src/main.c +++ b/src/main.c @@ -1436,6 +1436,7 @@ int main_loop(void) if (arm_timer()<0) goto error; timer_main(); }else{ + /* do nothing for main timer */ } if(sr_wtimer_start()<0) {
1
0
0
0
git:master:eef64d61: core: add missing #include header guard
by Henning Westerholt
19 Sep '19
19 Sep '19
Module: kamailio Branch: master Commit: eef64d618745b4837990603d1268f8f87d33c1a7 URL:
https://github.com/kamailio/kamailio/commit/eef64d618745b4837990603d1268f8f…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-19T23:59:52+02:00 core: add missing #include header guard --- Modified: src/core/name_alias.h --- Diff:
https://github.com/kamailio/kamailio/commit/eef64d618745b4837990603d1268f8f…
Patch:
https://github.com/kamailio/kamailio/commit/eef64d618745b4837990603d1268f8f…
--- diff --git a/src/core/name_alias.h b/src/core/name_alias.h index ed75330f80..7efb571bdd 100644 --- a/src/core/name_alias.h +++ b/src/core/name_alias.h @@ -27,6 +27,8 @@ */ +#ifndef name_alias_h +#define name_alias_h #include "str.h" #include "dprint.h" @@ -108,3 +110,4 @@ static inline int add_alias(char* name, int len, unsigned short port, +#endif \ No newline at end of file
1
0
0
0
git:master:9b7a8f90: core: replace glibc time function calls with the thread-safe versions
by Henning Westerholt
19 Sep '19
19 Sep '19
Module: kamailio Branch: master Commit: 9b7a8f90742ab03735c3c9f4fe3053d1f9f6fa35 URL:
https://github.com/kamailio/kamailio/commit/9b7a8f90742ab03735c3c9f4fe3053d…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-19T23:54:59+02:00 core: replace glibc time function calls with the thread-safe versions - replace glibc time function calls with the thread-safe versions, to prevent race conditions from multi-process / multi-threaded access - used in different utility functions which are used from core and modules - trivial change, only the respective variable types were changed --- Modified: src/core/ut.c --- Diff:
https://github.com/kamailio/kamailio/commit/9b7a8f90742ab03735c3c9f4fe3053d…
Patch:
https://github.com/kamailio/kamailio/commit/9b7a8f90742ab03735c3c9f4fe3053d…
--- diff --git a/src/core/ut.c b/src/core/ut.c index 5ee8f34db1..90b01d1026 100644 --- a/src/core/ut.c +++ b/src/core/ut.c @@ -99,7 +99,7 @@ int group2gid(int* gid, char* group) time_t _timegm(struct tm* t) { time_t tl, tb; - struct tm* tg; + struct tm tg; t->tm_isdst = 0; tl = mktime(t); @@ -112,12 +112,12 @@ time_t _timegm(struct tm* t) tl += 3600; } - tg = gmtime(&tl); - tg->tm_isdst = 0; - tb = mktime(tg); + gmtime_r(&tl, &tg); + tg.tm_isdst = 0; + tb = mktime(&tg); if (tb == -1) { - tg->tm_hour--; - tb = mktime (tg); + tg.tm_hour--; + tb = mktime (&tg); if (tb == -1) { return -1; /* can't deal with output from gmtime */ } @@ -130,22 +130,22 @@ time_t _timegm(struct tm* t) /* Convert time_t value that is relative to local timezone to UTC */ time_t local2utc(time_t in) { - struct tm* tt; - tt = gmtime(&in); - tt->tm_isdst = -1; - return mktime(tt); + struct tm tt; + gmtime_r(&in, &tt); + tt.tm_isdst = -1; + return mktime(&tt); } /* Convert time_t value in UTC to to value relative to local time zone */ time_t utc2local(time_t in) { - struct tm* tt; - tt = localtime(&in); + struct tm tt; + localtime_r(&in, &tt); #ifdef HAVE_TIMEGM - return timegm(tt); + return timegm(&tt); #else - return _timegm(tt); + return _timegm(&tt); #endif }
1
0
0
0
git:master:776d0d6b: core: replace glibc time function calls with the thread-safe versions
by Henning Westerholt
19 Sep '19
19 Sep '19
Module: kamailio Branch: master Commit: 776d0d6bb10866e330e62003b7ec5bfcf4761f1a URL:
https://github.com/kamailio/kamailio/commit/776d0d6bb10866e330e62003b7ec5bf…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-09-19T23:52:45+02:00 core: replace glibc time function calls with the thread-safe versions - replace glibc time function calls with the thread-safe versions, to prevent race conditions from multi-process / multi-threaded access - used in (undocumented) SER 'sys' selects, no functional change, locally tested --- Modified: src/core/select_core.c --- Diff:
https://github.com/kamailio/kamailio/commit/776d0d6bb10866e330e62003b7ec5bf…
Patch:
https://github.com/kamailio/kamailio/commit/776d0d6bb10866e330e62003b7ec5bf…
--- diff --git a/src/core/select_core.c b/src/core/select_core.c index c96db61104..6190c8b875 100644 --- a/src/core/select_core.c +++ b/src/core/select_core.c @@ -1542,16 +1542,22 @@ int select_sys_now_fmt(str* res, select_t* s, struct sip_msg* msg) { #define SEL_POS 2 time_t t; - struct tm *tm; + struct tm tm; t = time(NULL); switch (s->params[SEL_POS].v.i) { case SEL_NOW_GMT: - tm = gmtime(&t); + if (! gmtime_r(&t, &tm)) { + ERR("Invalid UTC time value\n"); + return -1; + } break; case SEL_NOW_LOCAL: - tm = localtime(&t); + if (! localtime_r(&t, &tm)) { + ERR("Invalid local time value\n"); + return -1; + } break; default: BUG("Unexpected parameter value 'now' \"%d\" (%p)\n", @@ -1559,19 +1565,22 @@ int select_sys_now_fmt(str* res, select_t* s, struct sip_msg* msg) return -1; } if (s->n <= SEL_POS+1) { - char *c; - c = asctime(tm); - res->len = strlen(c); - while (res->len && c[res->len-1] < ' ') res->len--; /* rtrim */ + char buff[25]; + if (! asctime_r(&tm, buff)) { + ERR("Invalid time value\n"); + return -1; + } + res->len = strlen(buff); + while (res->len && buff[res->len-1] < ' ') res->len--; /* rtrim */ res->s = get_static_buffer(res->len); if (!res->s) return -1; - memcpy(res->s, c, res->len); + memcpy(res->s, &buff, res->len); } else { char c, buff[80]; c = s->params[SEL_POS+1].v.s.s[s->params[SEL_POS+1].v.s.len]; s->params[SEL_POS+1].v.s.s[s->params[SEL_POS+1].v.s.len] = '\0'; - res->len = strftime(buff, sizeof(buff)-1, s->params[SEL_POS+1].v.s.s, tm); + res->len = strftime(buff, sizeof(buff)-1, s->params[SEL_POS+1].v.s.s, &tm); s->params[SEL_POS+1].v.s.s[s->params[SEL_POS+1].v.s.len] = c; res->s = get_static_buffer(res->len); if (!res->s) return -1;
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
37
Older →
Jump to page:
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
Results per page:
10
25
50
100
200