emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warning in svg_load_image


From: Po Lu
Subject: Re: Warning in svg_load_image
Date: Mon, 21 Feb 2022 21:37:44 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Not really, but does the below fix these, by chance?

Unfortunately not.  Now I get this slightly different warning:

  CC       image.o
image.c: In function 'svg_load_image':
image.c:10776:7: warning: '%.0f' directive output may be truncated writing 
between 1 and 310 bytes into a region of size between 171 and 191 
[-Wformat-truncation=]
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"; "
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
image.c:10780:22: note: format string is defined here
       "viewBox=\"0 0 %.0f %.0f\">"
                      ^~~~
image.c:10776:7: note: directive argument in the range [0, 16777215]
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"; "
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
image.c:10776:7: note: assuming directive output of 1 byte
image.c:10802:24: note: 'snprintf' output 316 or more bytes (assuming 317) into 
a destination of size 387
     if (buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      foreground & 0xFFFFFF, width, height,
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /* Sanitize the viewBox dimensions.  */
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      min (viewbox_width, 10000.),
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      min (viewbox_height, 10000.),
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      background & 0xFFFFFF,
      ~~~~~~~~~~~~~~~~~~~~~~
      SSDATA (encoded_contents)))
      ~~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]