Merge pull request #15734 from opensourcerouting/fix/compile_truncation

Fix compile warning with -Wformat-truncation
This commit is contained in:
Donald Sharp 2024-04-15 11:23:15 -04:00 committed by GitHub
commit 971455c9f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -2908,7 +2908,7 @@ static void show_isis_route_common(struct vty *vty, int levels,
struct isis_spftree *spftree; struct isis_spftree *spftree;
struct listnode *node; struct listnode *node;
struct isis_area *area; struct isis_area *area;
char key[8]; char key[18];
if (!isis->area_list || isis->area_list->count == 0) if (!isis->area_list || isis->area_list->count == 0)
return; return;

View File

@ -2740,9 +2740,9 @@ static void show_sr_node(struct vty *vty, struct json_object *json,
if (srn->algo[i] == SR_ALGORITHM_UNSET) if (srn->algo[i] == SR_ALGORITHM_UNSET)
continue; continue;
json_obj = json_object_new_object(); json_obj = json_object_new_object();
char tmp[2]; char tmp[12];
snprintf(tmp, sizeof(tmp), "%u", i); snprintf(tmp, sizeof(tmp), "%d", i);
json_object_string_add(json_obj, tmp, json_object_string_add(json_obj, tmp,
srn->algo[i] == SR_ALGORITHM_SPF srn->algo[i] == SR_ALGORITHM_SPF
? "SPF" ? "SPF"