p = errstr + ngx_cached_err_log_time.len;
- p = ngx_sprintf(p, " [%s] ", err_levels[level]);
+ p = ngx_snprintf(p, last - p, " [%s] ", err_levels[level]);
/* pid#tid */
- p = ngx_sprintf(p, "%P#" NGX_TID_T_FMT ": ", ngx_log_pid, ngx_log_tid);
+ p = ngx_snprintf(p, last - p, "%P#" NGX_TID_T_FMT ": ",
+ ngx_log_pid, ngx_log_tid);
if (log->connection) {
- p = ngx_sprintf(p, "*%uA ", log->connection);
+ p = ngx_snprintf(p, last - p, "*%uA ", log->connection);
}
#if (NGX_HAVE_VARIADIC_MACROS)