summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/utils/net_time.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index b6198376af..d37b5aac68 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -78,7 +78,6 @@ static time_t nettime(struct net_context *c, int *zone)
/* return a time as a string ready to be passed to /bin/date */
static const char *systime(time_t t)
{
- static fstring s;
struct tm *tm;
tm = localtime(&t);
@@ -86,10 +85,9 @@ static const char *systime(time_t t)
return "unknown";
}
- fstr_sprintf(s, "%02d%02d%02d%02d%04d.%02d",
- tm->tm_mon+1, tm->tm_mday, tm->tm_hour,
- tm->tm_min, tm->tm_year + 1900, tm->tm_sec);
- return s;
+ return talloc_asprintf(talloc_tos(), "%02d%02d%02d%02d%04d.%02d",
+ tm->tm_mon+1, tm->tm_mday, tm->tm_hour,
+ tm->tm_min, tm->tm_year + 1900, tm->tm_sec);
}
int net_time_usage(struct net_context *c, int argc, const char **argv)