We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ac4e04 commit 3f7a5fdCopy full SHA for 3f7a5fd
1 file changed
src/trsp-update.c
@@ -287,11 +287,10 @@ void trsp_update_files(gchar * input_file)
287
*key = nx_json_get(json_obj, "mode_id")->int_value;
288
nmode = g_hash_table_lookup(modes_hash, key);
289
if (nmode != NULL)
290
- sprintf(m_trsp.mode, "%s", nmode->modname);
+ g_strlcpy(m_trsp.mode, nmode->modname, sizeof(m_trsp.mode));
291
else
292
- sprintf(m_trsp.mode, "%lli",
293
- nx_json_get(json_obj,
294
- "mode_id")->int_value);
+ g_snprintf(m_trsp.mode, sizeof(m_trsp.mode), "%lli",
+ nx_json_get(json_obj, "mode_id")->int_value);
295
296
m_trsp.invert =
297
nx_json_get(json_obj, "invert")->int_value;
0 commit comments