core: Avoid trivial snprintfs.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 34m10s

This commit is contained in:
2025-06-10 21:17:55 -04:00
parent 3a2a829940
commit b135a210cc
13 changed files with 96 additions and 74 deletions

View File

@ -1166,7 +1166,7 @@ static JSValue _tf_task_executeSource(tf_task_t* task, const char* source, const
JSValue result = JS_Eval(task->_context, source, strlen(source), name, JS_EVAL_TYPE_MODULE | JS_EVAL_FLAG_ASYNC);
if (!*task->_scriptName)
{
snprintf(task->_scriptName, sizeof(task->_scriptName), "%s", name);
tf_string_set(task->_scriptName, sizeof(task->_scriptName), name);
}
tf_trace_end(task->_trace);
return result;
@ -1966,7 +1966,7 @@ void tf_task_set_ssb_network_key(tf_task_t* task, const char* network_key)
void tf_task_set_db_path(tf_task_t* task, const char* db_path)
{
snprintf(task->_db_path, sizeof(task->_db_path), "%s", db_path);
tf_string_set(task->_db_path, sizeof(task->_db_path), db_path);
}
void tf_task_set_zip_path(tf_task_t* task, const char* zip_path)
@ -1976,7 +1976,7 @@ void tf_task_set_zip_path(tf_task_t* task, const char* zip_path)
unzClose(task->_zip);
task->_zip = NULL;
}
snprintf(task->_zip_path, sizeof(task->_zip_path), "%s", zip_path);
tf_string_set(task->_zip_path, sizeof(task->_zip_path), zip_path);
if (zip_path)
{
task->_zip = unzOpen(zip_path);
@ -1986,7 +1986,7 @@ void tf_task_set_zip_path(tf_task_t* task, const char* zip_path)
void tf_task_set_root_path(tf_task_t* task, const char* path)
{
snprintf(task->_root_path, sizeof(task->_root_path), "%s", path ? path : "");
tf_string_set(task->_root_path, sizeof(task->_root_path), path ? path : "");
}
const char* tf_task_get_zip_path(tf_task_t* task)