Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 031961fccd6f43a166d4795041271c5df468b2a0
Ticket: 624919ffffffffffffffffffffffffffffffffff
Tcl_AppendToObj docs confusing
User & Date: nobody on 2002-10-21 22:49:03
Changes

  1. icomment:
    Logged In: NO 
    
    Yeah, worked for me on what I could type in, too, but the bug 
    persists. I did some more digging. Here's the scenario.
    The offending array arguments have embedded nulls at the 
    end. The objects are created in C:
    dicomDumpObject( ...tcl args ...) {
    char buffer[8192];
    Tcl_Obj *theSize, *element, *theTagd, *theTagl, 
    *elementsize, *theList, *theString;
    sprintf(buffer,"");
    element = Tcl_NewStringObj(buffer, strlen(buffer));
    theString = Tcl_NewStringObj("ELEMENTLIST", -1);
    theList = Tcl_NewListObj(1, &theString);
    stringLength = elementItem->element.length;
    strncpy((char *)scratch, elementItem->element.d.string, 
    stringLength);
    scratch[stringLength] = '\0';
    Tcl_AppendToObj(element,(char *)scratch,stringLength);
    Tcl_ListObjAppendElement(NULL,theList,element);
    Tcl_SetObjResult(interp,theList);
    return(TCL_OK);
    }
    
    There are other items in the list, such that the entire list is 
    putarray format, so to read the objects into TCL, I use:
    array set a [dicomDumpObject $o]
    This populates the array correctly, but the subscripts that 
    contain appended nulls fail when using [info exists a($v)].
    
    Yes, the string array names are ASN values, probably much 
    like LDAP.
    
    This procedure uses TCL from end to end, after the values 
    are copied in using Tcl_AppendToObj, which according to the 
    man page, handles almost anything.
    
    -Mahlon
    
    
    
    
  2. login: "nobody"
  3. mimetype: "text/plain"
  4. username: "nobody"