[Libguestfs] [PATCH 3/5] lib: inspect: gpt_prefix is a constant string.

Pino Toscano ptoscano at redhat.com
Mon Mar 7 09:42:22 UTC 2016


On Sunday 06 March 2016 23:08:59 Richard W.M. Jones wrote:
> ---
>  src/inspect-fs-windows.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/inspect-fs-windows.c b/src/inspect-fs-windows.c
> index ba72727..5adf145 100644
> --- a/src/inspect-fs-windows.c
> +++ b/src/inspect-fs-windows.c
> @@ -389,7 +389,7 @@ check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs)
>    int r;
>    size_t len = strlen (fs->windows_systemroot) + 64;
>    char system[len];
> -  char gpt_prefix[] = "DMIO:ID:";
> +  const char gpt_prefix[] = "DMIO:ID:";

This could even be static IMHO, so not even on stack but directly in
the .rodata section.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160307/5a76a602/attachment.sig>


More information about the Libguestfs mailing list