bug-ncurses
[Top][All Lists]
Advanced

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

Re: Picsmap Test Patch


From: Thomas Dickey
Subject: Re: Picsmap Test Patch
Date: Sat, 21 Apr 2018 15:19:31 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Apr 16, 2018 at 09:00:35AM -0400, 顔無し wrote:
> Hello.  The attached patch prevents potential access of a NULL array and a 
> few other quirks I noticed in the picsmap test program.
> 
> The test programs are a wonderful resource.  I especially enjoy ditto and 
> hope to use it to explore possibilities with detecting simultaneous 
> keypresses.
> 
> Grady

thanks - but:

> --- picsmap.c 2017-05-27 20:19:58.000000000 -0400
> +++ picsmap.c.new     2018-04-16 08:39:17.056213014 -0400
> @@ -84,8 +84,10 @@
>  static void
>  free_data(char **data)
>  {
> -    free(data[0]);
> -    free(data);
> +    if (data) {
> +        free(data[0]);
> +        free(data);
> +    }
>  }

this fix was in 20170610...
  
>  static void
> @@ -149,7 +151,7 @@
>  {
>      static const char *msg[] =
>      {
> -     "Usage: picsmap [-x rgb-path] [xbm-file [...]]"
> +     "Usage: picsmap [-r rgb-path] [xbm-/xpm-file [...]]"
>      };
>      size_t n;

I changed this a few times in May/June last year before settling on this
wording:

        "Usage: picsmap [options] [imagefile [...]]"
        ,"Read/display one or more xbm/xpm files (possibly use \"convert\")"

> @@ -824,7 +826,7 @@
>       }
>      }
>  
> -    if (argc > 1) {
> +    if (argc > optind) {
>       char **rgb_data = read_file(rgb_path);
>  
>       if (rgb_data)
> @@ -841,7 +843,7 @@
>           endwin();
>       }
>  
> -     for (n = 1; n < argc; ++n) {
> +     for (n = optind; n < argc; ++n) {
>           PICS_HEAD *pics;
>           char **data = read_file(argv[n]);

and this was in 20170603

-- 
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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