terminal: convert to strnprintf()

parent 62eda135
...@@ -209,8 +209,8 @@ static int lxc_terminal_rotate_log_file(struct lxc_terminal *terminal) ...@@ -209,8 +209,8 @@ static int lxc_terminal_rotate_log_file(struct lxc_terminal *terminal)
len = strlen(terminal->log_path) + sizeof(".1"); len = strlen(terminal->log_path) + sizeof(".1");
tmp = must_realloc(NULL, len); tmp = must_realloc(NULL, len);
ret = snprintf(tmp, len, "%s.1", terminal->log_path); ret = strnprintf(tmp, len, "%s.1", terminal->log_path);
if (ret < 0 || (size_t)ret >= len) if (ret < 0)
return -EFBIG; return -EFBIG;
close(terminal->log_fd); close(terminal->log_fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment