mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Cleanup: remove use of strcpy, following our own convention
Ref !157497
This commit is contained in:
parent
89a8ba391e
commit
efcd69f7d4
3 changed files with 7 additions and 5 deletions
|
|
@ -872,11 +872,11 @@ static Vector<Error> eval_template(std::string *r_out_path,
|
|||
|
||||
/* Curly brace escapes. */
|
||||
case TokenType::LEFT_CURLY_BRACE: {
|
||||
strcpy(replacement_string, "{");
|
||||
ARRAY_SET_ITEMS(replacement_string, '{', '\0');
|
||||
break;
|
||||
}
|
||||
case TokenType::RIGHT_CURLY_BRACE: {
|
||||
strcpy(replacement_string, "}");
|
||||
ARRAY_SET_ITEMS(replacement_string, '}', '\0');
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1480,8 +1480,9 @@ char **BKE_sound_get_device_names()
|
|||
|
||||
for (int i = 0; i < v_names.size(); i++) {
|
||||
std::string name = v_names[i];
|
||||
names[i] = (char *)malloc(sizeof(char) * (name.length() + 1));
|
||||
strcpy(names[i], name.c_str());
|
||||
const size_t name_size = sizeof(char) * (name.length() + 1);
|
||||
names[i] = (char *)malloc(name_size);
|
||||
memcpy(names[i], name.c_str(), name_size);
|
||||
}
|
||||
names[v_names.size()] = nullptr;
|
||||
audio_device_names = names;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include "DNA_space_types.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_string_utf8.h"
|
||||
|
||||
#include "BKE_appdir.hh"
|
||||
#include "BKE_blendfile.hh"
|
||||
|
|
@ -173,7 +174,7 @@ static wmOperatorStatus node_clipboard_copy_exec(bContext *C, wmOperator *op)
|
|||
{(PartialWriteContext::IDAddOperations::SET_FAKE_USER |
|
||||
PartialWriteContext::IDAddOperations::SET_CLIPBOARD_MARK)}));
|
||||
|
||||
strcpy(copy_tree->idname, node_tree->typeinfo->idname.c_str());
|
||||
STRNCPY_UTF8(copy_tree->idname, node_tree->typeinfo->idname.c_str());
|
||||
bke::node_tree_set_type(*copy_tree);
|
||||
|
||||
/* Copy node interface to avoid losing links to Group Input and Group Output nodes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue