[LU-9831] Truncation of output string in lsnapshot.c::jt_snapshot_create Created: 04/Aug/17  Updated: 04/Aug/17

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

This is highlighted by modern gcc and I guess not so important in the end, but the warnng breaks the compile:

lsnapshot.c: In function Б─≤jt_snapshot_createБ─≥:
lsnapshot.c:1328:31: error: Б─≤snprintfБ─≥ output truncated before the last format character [-Werror=format-truncation=]
  snprintf(new_fsname, 8, "%08x", (__u32)random());
                               ^
lsnapshot.c:1328:2: note: Б─≤snprintfБ─≥ output 9 bytes into a destination of size 8
  snprintf(new_fsname, 8, "%08x", (__u32)random());
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Generated at Sat Feb 10 02:29:40 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.