[GRASS-git] [OSGeo/grass] b6e41c: Small code fixes for d.legend and Cairo_Text (#1076)

Vaclav Petras noreply at github.com
Tue Nov 17 20:15:57 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/OSGeo/grass
  Commit: b6e41c1aee45fc54b3a91db330c7b5e3e47d6f08
      https://github.com/OSGeo/grass/commit/b6e41c1aee45fc54b3a91db330c7b5e3e47d6f08
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M display/d.legend/draw.c
    M display/d.legend/main.c
    M lib/cairodriver/text.c

  Log Message:
  -----------
  Small code fixes for d.legend and Cairo_Text (#1076)

MaxLabel needs to hold buff plus one (e.g. for a space) to avoid several
warnings: sprintf may write a terminating nul past the end of the destination
[-Wformat-overflow=] with GCC.

D_save_command needs to be called only one per standard module call
(although should be removed in the future). draw() is called twice with bg drawing.

D_text call seems to be badly indented, but in a correct branch, so fixing
warning: this if clause does not guard... [-Wmisleading-indentation].

Various iconv documetations specify the retun value on error as (iconv_t) -1
for iconv_open, so test specifically for that and avoid
warning: ordered comparison of pointer with integer zero [-Wextra].

Fix also a typo and empty line at the end of file.




More information about the grass-commit mailing list