Re: tn3270 on SUNos 4.0


Greg Minshall (amdahl!pacbell!varian!kinetics!minshall@ames.arc.nasa.gov)
14 Sep 88 17:53:54 GMT


>From article <57@dftsrv.gsfc.nasa.gov>, by tomc@dftsrv.gsfc.nasa.gov (Tom Corsetti):
> Hi!
> I'm posting this article for a friend here who has no access to 'news'.
> He has a sun4 running sunos 4.0 (all the 4.3 bsd stuff). He's trying
> to get tn3270 (the telnet for emulating ibm 3270 type terminals) to
> work. He says that it compiles ok using the makefile for 4.3 bsd. But
> when he tries to run it, he gets a segmentation fault when the software
> appears to be trying to make a connection. Has anyone out there got
> any suggestions, or run into this problem before? Thanks in advance!
> - Tom Corsetti

This fix goes in telnet.c (or maybe tn3270.c, if you are using an
older version). tn3270 (and telnet, for that matter) were using
a "varargs" routine without using the "varargs" mechanism.

Replace the routine "call()" with the code below.

Sorry, about that.

Greg Minshall

----
/*
 * Call routine with argc, argv set from args (terminated by 0).
 */
#include <varargs.h>
static
call(va_alist)
va_dcl
{
    va_list ap;
    typedef int (*intrtn_t)();
    intrtn_t routine;
    char *args[100];

    int argno = 0;

    va_start(ap);
    routine = (va_arg(ap, intrtn_t));
    while (args[argno++] = va_arg(ap, char *))
        ;
    va_end(ap);
    return (*routine)(argno, args);
}



This archive was generated by hypermail 2.0b3 on Thu Mar 09 2000 - 14:43:30 GMT