 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 4/6] tools/libfsimage: Add an fdopen() interface to libfsimage
 On 22/11/2023 22:29, Andrew Cooper wrote: I think it's leftover from code I needed initially and then didn't anymore. Safe to get rid of.On 06/11/2023 3:05 pm, Alejandro Vallejo wrote: Maybe. I admit optimising that line went pretty low on the list of things I cared terribly about. I'm happy to reduce it, but it is inconsequential.diff --git a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c index 864a15b349..9f07ea288f 100644 --- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c +++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c @@ -25,15 +25,25 @@ #include INCLUDE_EXTFS_H #include <errno.h> #include <inttypes.h> +#include <stdio.h>static int For wellformed fd's that's true. Through bugs or malice that may not be the case. I'm happier knowing at least the last zero remains.Given that it is guaranteed long enough, you don't need to zero it just to have snprintf() write a well-formed string in. ~Andrew Cheers, Alejandro 
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |