mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
sunrpc: Fix netname build with older gcc
The -Wformat-overflow was added by gcc 8.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 0eb6b2725b
)
This commit is contained in:
parent
bd9f194c34
commit
8b8a3f0aaf
@ -52,10 +52,14 @@ user2netname (char netname[MAXNETNAMELEN + 1], const uid_t uid,
|
||||
/* GCC with -Os or -O1 warns that sprint might overflow while handling
|
||||
dfltdom, however the above test does check if an overflow would
|
||||
happen. */
|
||||
#if __GNUC_PREREQ (8, 0)
|
||||
DIAG_PUSH_NEEDS_COMMENT;
|
||||
DIAG_IGNORE_NEEDS_COMMENT (8, "-Wformat-overflow");
|
||||
#endif
|
||||
sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom);
|
||||
#if __GNUC_PREREQ (8, 0)
|
||||
DIAG_POP_NEEDS_COMMENT;
|
||||
#endif
|
||||
i = strlen (netname);
|
||||
if (netname[i - 1] == '.')
|
||||
netname[i - 1] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user