Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: jkb@mrc-lmb.cam.ac.uk (James Bonfield)
Subject: Atom bugs
Date: 1997/08/14	[thread overview]
Message-ID: <5svf0j$78h$1@lyra.csx.cam.ac.uk> (raw)



I'm trying desperately to get atom+third degree to work reliably on
pretty much anything I try. I'm using Digital Unix V4.0, with third
degree v 4.2. I have the following code - part of tcl8.0:

int
Tcl_GetBoolean(interp, string, boolPtr)
    Tcl_Interp *interp;         /* Interpreter used for error reporting. */
    char *string;               /* String containing a boolean number
                                 * specified either as 1/0 or true/false or
                                 * yes/no. */
    int *boolPtr;               /* Place to store converted result, which
                                 * will be 0 or 1. */
{
    int i;
    char lowerCase[10], c;
    size_t length;

    /*
     * Convert the input string to all lower-case.
     */

    for (i = 0; i < 9; i++) {
        c = string[i];
        if (c == 0) {
            break;
        }
        if ((c >= 'A') && (c <= 'Z')) {
            c += (char) ('a' - 'A');
        }
        lowerCase[i] = c;
    }
    lowerCase[i] = 0;  /* line 295 */

When running "atom wish -tool third", and then wish.third -f
../library/demos/widget.tcl (and then quitting it), I get in
wish.3log:

---------------------------------------------------------------- rus -- 0 --
./../generic/tclGet.c: 295: reading uninitialized local variable lowerCase + 1 bytes of Tcl_GetBoolean
    Tcl_GetBoolean                 wish, tclGet.c, line 295
    DoConfig                       wish, tkConfig.c, line 347
(etc)

Now I'm _sure_ this can't be true. Firstly, it's an assignment to
lowerCase[i], not a read. And secondly, 'i' can only ever be in the
range of 0 to 9 inclusive, which is inside the array boundaries. Am I
doing something wrong or is atom acting buggily? If so, is there a
known fix?

Thanks in advance,

	James
--
James Bonfield (jkb@mrc-lmb.cam.ac.uk)   Tel: 01223 402499   Fax: 01223 213556
Medical Research Council - Laboratory of Molecular Biology,
Hills Road, Cambridge, CB2 2QH, England.
Also see Staden Package WWW site at http://www.mrc-lmb.cam.ac.uk/pubseq/



                 reply	other threads:[~1997-08-14  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox