mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
Silenced warnings about string lengths in snprintf()
Adjust string lengths to the worst case estimated by the compiler, even though they cannot be reached.
This commit is contained in:
parent
c5530af508
commit
b68c27ea74
@ -141,7 +141,8 @@ static int fstrim_limits(ntfs_volume *vol,
|
||||
u64 *discard_max_bytes)
|
||||
{
|
||||
struct stat statbuf;
|
||||
char path1[80], path2[80];
|
||||
char path1[40]; /* holds "/sys/dev/block/%d:%d" */
|
||||
char path2[40 + sizeof(path1)]; /* less than 40 bytes more than path1 */
|
||||
int ret;
|
||||
|
||||
/* Stat the backing device. Caller has ensured it is a block device. */
|
||||
|
@ -45,8 +45,8 @@ canonicalize_dm_name(const char *ptname, char *canonical)
|
||||
{
|
||||
FILE *f;
|
||||
size_t sz;
|
||||
char path[MAPPERNAMELTH + 24];
|
||||
char name[MAPPERNAMELTH + 16];
|
||||
char path[sizeof(name) + 16];
|
||||
char *res = NULL;
|
||||
|
||||
snprintf(path, sizeof(path), "/sys/block/%s/dm/name", ptname);
|
||||
|
Loading…
Reference in New Issue
Block a user