diff options
author | hwspeedy <ns@bigbear.dk> | 2024-03-15 01:43:07 +0100 |
---|---|---|
committer | hwspeedy <ns@bigbear.dk> | 2024-03-15 01:43:07 +0100 |
commit | f88fd2c25040a784196d270917a5d6e049d5d614 (patch) | |
tree | 1d6516b49354d66b8338e305ff98766b232b26ee /deps/sysobj_early/src/util_ids.c | |
parent | 3e5d70b7d9e1555e516547c7d6d56b712ea4ed15 (diff) |
FIX GCC warnings strncpy
Diffstat (limited to 'deps/sysobj_early/src/util_ids.c')
-rw-r--r-- | deps/sysobj_early/src/util_ids.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/deps/sysobj_early/src/util_ids.c b/deps/sysobj_early/src/util_ids.c index 197b1ed3..9546a8b7 100644 --- a/deps/sysobj_early/src/util_ids.c +++ b/deps/sysobj_early/src/util_ids.c @@ -243,7 +243,7 @@ GSList *ids_file_all_get_all(const gchar *file, split_loc_function split_loc_fun ids_query_result *working = g_new0(ids_query_result, 1); gchar **qparts = g_new0(gchar*, IDS_LOOKUP_MAX_DEPTH + 1); for(tabs = IDS_LOOKUP_MAX_DEPTH-1; tabs>=0; tabs--) - qparts[tabs] = g_malloc0(IDS_LOOKUP_BUFF_SIZE); + qparts[tabs] = g_malloc0(IDS_LOOKUP_BUFF_SIZE+1); tabs = 0; if (!split_loc_func) split_loc_func = split_loc_default; @@ -290,7 +290,7 @@ GSList *ids_file_all_get_all(const gchar *file, split_loc_function split_loc_fun // now p = id, name = name // ids_msg("p: %s -- name: %s", p, name); - strncpy(qparts[tabs], p, IDS_LOOKUP_BUFF_SIZE-1); + strncpy(qparts[tabs], p, IDS_LOOKUP_BUFF_SIZE); ids_query_result_set_str(working, tabs, name); if (tabs < tabs_last) for(;tabs_last > tabs; tabs_last--) { |