Subject: Problem when compiling Pine 3.92

From: Andrej Borsenkow <[email-masked]>
Date: Sat, 23 Mar 1996 16:45:07 +0300 (MOW)

Hi all!

I have seen strange problem when compiling Pine 3.92.

There is a structure "headerentry" defined in pico/pico.h. It is used in
two places; in pine/addrbook.c and pine/send.c. In both cases a static
array of structure headerentry is defined and initialized.

The problem was, two elements were omitted when intializing the structure.
I recall, that some compilers allow it and just silently zap remain with
zeroes; my compiler barks :-(

I include the structure definition and example of intializing:

=============== structure form pico/pico.h ==================

struct headerentry {
        char     *prompt;
	char	 *name;
#if defined(DOS) || defined(HELPFILE)
	short	  help;
#else
	char	**help;
#endif
        int	  prlen;
        int	  maxlen;
        char    **realaddr;
        int     (*builder)();        /* Function to verify/canonicalize val */
	struct headerentry        *affected_entry, *next_affected;
				     /* entry builder's 4th arg affects     */
        char   *(*selector)();       /* Browser for possible values         */
        char     *key_label;         /* Key label for key to call browser   */
        unsigned  display_it:1;	     /* field is to be displayed by default */
        unsigned  break_on_comma:1;  /* Field breaks on commas              */
        unsigned  is_attach:1;       /* Special case field for attachments  */
        unsigned  rich_header:1;     /* Field is part of rich header        */
        unsigned  only_file_chars:1; /* Field is a file name                */
        unsigned  single_space:1;    /* Crush multiple spaces into one      */
        unsigned  sticky:1;          /* Can't change this via affected_entry*/
        unsigned  dirty:1;           /* We've changed this entry            */
	unsigned  start_here:1;	     /* begin composer on first on lit      */
#ifdef	KS_OSDATAVAR
	KS_OSDATAVAR		     /* Port-Specific keymenu data */
#endif
        struct    hdr_line        *hd_text;
};

================== use of it in pine/send.c =====================

/* this is for initializing the fixed header elements in pine_send() */
/*
prompt::name::help::prlen::maxlen::realaddr::
builder::affected_entry::next_affected::selector::key_label::
display_it::break_on_comma::is_attach::rich_header::only_file_chars::
single_space::sticky::hd_text
*/
static struct headerentry he_template[]={
  {"From    : ",  "From",        h_composer_from,       10, 0, NULL,
   build_address, NULL, NULL, addr_book_compose,    "To AddrBk",
   0, 1, 0, 1, 0, 1, 0, KS_TOADDRBOOK},
  {"Reply-To: ",  "Reply To",    h_composer_reply_to,   10, 0, NULL,
   build_address, NULL, NULL, addr_book_compose,    "To AddrBk",
   0, 1, 0, 1, 0, 1, 0, KS_TOADDRBOOK},

        ... skipped ...

=========================================================

As you see, two elements (dirty and start_here) are not initializes;
moreover, they are not even mentioned in comments. Also, it looks strange
with KS_OSDATAVAR and hdr_line fields; probably, they also should be
intialized conditionally.

Have anybody also seen it? Probably, I got some wrong distribution - I
picked it up from mirror site in Germany, not form ftp.cac.washington.edu?

thanks in advance

-------------------------------------------------------------------------
Andrej Borsenkow 		Fax:   +7 (095) 252 01 05
SNI ITS Moscow			Tel:   +7 (095) 252 13 88

NERV:  borsenkow.msk		E-Mail: [email-masked]
-------------------------------------------------------------------------

---

From: Steve Hubert <[email-masked]>
Date: Sat, 23 Mar 1996 23:05:10 -0800 (PST)

No, the version you got is the same as the one from our site and it is
indeed a bug.  Thanks for noticing it.  It will be fixed in 3.93.  If you
just want to edit to make your compiler happy, initialize those two
variables to zero everywhere (which is what 3.93 will do).  Thanks.

Steve Hubert <[email-masked]>
Networks and Distributed Computing, Univ. of Washington, Seattle