Also, change the way console input is passed to the subprocess -- instead of
echoing it in sushi, instead set the pty to cooked mode and have it do any
echoing. This will work better if we have scripts that accept input (sometimes
we don't want it visible; e.g. if it's a password) and also has the side effect
of allowing a command to be interrupted with ^C.
that for form subwindow, which may be NULL (or is always, even?).
This fixes SIGSEGV when one goes to
Network related configuration -> Modify the hosts file -> Delete host entries
and presses F1 (Help).
process_{pre,}form(): g/c unnecessary malloc, plug memory leak
gen_list(): only check ftp->list after realloc()
handle_{pre,}form(): allocate F[] via calloc(3), so that the memory is
properly zeroed
to get amount of fields on the form instead.
This fixes a SIGSEGV problem I encountered, and possibly also the crash part
of bin/17718 by Grant Beattie.
policy and the data dependent initialization is very fragile. I.e.
the code assumes because the data entry is of type foo, it has
initialized certain fields and others not.
- make sure list is not NULL before you use it.
- don't realloc on every loop iteration!
- don't increment i when there are short lines; leads to uninitialized
list[i] entries [fixes bills' core-dump, hi bill!]
- don't allocate:
char *p = malloc(len * sizeof(char *))
when you mean:
char *p = malloc(len)
- eliminate duplicated code by creating functions and try not to wrap
- use mvwinnstr instead of mvwinstr
function does not exist a little better, rather than dying later in fgetln.
Also fix up a wierd corner case in escript where the programmer forgets
to put in the scriptname.
to do with very large fields being cut off by the end of the screen.
Also.. change the max-width of an onscreen field to 19 from 21.. I don't
know where I got 21 from.. but it was definately wrong.
Add new form keyword, iscript, which allows script generated integer fields.
This uncovered a whole host of bugs, which uncovered a whole host of memory
leaks, which hopefully I've fixed most of now (in this file at least).