mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 08:50:26 +00:00
ospfd: Fix compile warning with -Wformat-truncation
ospfd/ospf_sr.c: In function ‘show_sr_node.part.5’: ospfd/ospf_sr.c:2745:32: warning: ‘%u’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] snprintf(tmp, sizeof(tmp), "%u", i); ^~ ospfd/ospf_sr.c:2745:31: note: directive argument in the range [0, 2147483646] snprintf(tmp, sizeof(tmp), "%u", i); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
50e85abc25
commit
f003ccf16b
@ -2740,9 +2740,9 @@ static void show_sr_node(struct vty *vty, struct json_object *json,
|
||||
if (srn->algo[i] == SR_ALGORITHM_UNSET)
|
||||
continue;
|
||||
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,
|
||||
srn->algo[i] == SR_ALGORITHM_SPF
|
||||
? "SPF"
|
||||
|
Loading…
Reference in New Issue
Block a user