[comp.sys.amiga] More fixes for DBW's vc

hardie@sask.UUCP (01/22/87)

Dave beat me to it. I was also working on porting the vc program to the
amiga. His looks nicer but contains three bugs that I had already
uncovered. The E command bombs if there is no string to be edited
and the W and T commands can't open the file that you specify.
The fixes are easy and follow:
In 'edits' add the two lines marked with /**/ as shown:
The problem is that if there is no string to edit then the sprintf
prints a string from address 0 which generates garbage.
edits (row, col) {
    register struct ent *p = lookat (row, col);
    sprintf (line, "%sstring %s%d = \"",
                        ((p->flags&is_leftflush) ? "left" : "right"),
                        coltoa(col), row);
    linelim = strlen(line);
/**/    if(p->label) {
       sprintf (line+linelim, "%s", p->label);
       linelim += strlen (line+linelim);
/**/    }
}

In both the printfile and tblprintfile routines add the char *fname declaration
otherwise fname defaults to the wrong type.
printfile (fname)
char *fname;
{

tblprintfile (fname)
char *fname;
{



A previous article on vc said that the earlier version I ported 
(that is on Fish disk 35)
bombed when run with popcli etc. I am not sure why it happens but it does
not occur with Dave's version so use his!

Pete Hardie
ihnp4!sask!hardie