mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: revert incorrect path length size for sscanf
Commit 94786a3bbf
introduced
another bug - since sscanf needs extra 1 byte for \0.
Since there is no easy way to do a macro evaluation for (PATH_MAX-1)
and string concatation of this number to get resulting (%4095s) - let's
go with easiest path and restore extra byte for 0.
Other option would be to prepare sscanf parsing string in runtime.
But lets resolve it when we look at PATH_MAX handling later...
This commit is contained in:
parent
2faf416e0e
commit
93e9b3a1d1
@ -1649,8 +1649,8 @@ static void _unmangle_mountinfo_string(const char *src, char *buf)
|
||||
/* Parse one line of mountinfo and unmangled target line */
|
||||
static int _mountinfo_parse_line(const char *line, unsigned *maj, unsigned *min, char *buf)
|
||||
{
|
||||
char root[PATH_MAX];
|
||||
char target[PATH_MAX];
|
||||
char root[PATH_MAX + 1]; /* sscanf needs extra '\0' */
|
||||
char target[PATH_MAX + 1];
|
||||
|
||||
/* TODO: maybe detect availability of %ms glib support ? */
|
||||
if (sscanf(line, "%*u %*u %u:%u %" DM_TO_STRING(PATH_MAX)
|
||||
|
Loading…
Reference in New Issue
Block a user