We are going to want to pass these, and currently the test harness
will dereference the NULL. So fix this.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
void Tvbfdset(int max, const fd_set *fds) {
int i;
const char *comma= "";
+ if (!fds) {
+ Tvba("null");
+ return;
+ }
Tvba("[");
for (i=0; i<max; i++) {
if (!FD_ISSET(i,fds)) continue;
int i;
const char *comma= "";
+ if (!fds) {
+ Tvba("null");
+ return;
+ }
+
Tvba("[");
for (i=0; i<max; i++) {
if (!FD_ISSET(i,fds)) continue;
static void Pfdset(fd_set *set, int max) {
int r, c;
char *ep;
+ if (!set) {
+ Pstring("null","null fdset pointer");
+ return;
+ }
if (vb2.buf[vb2.used++] != '[') Psyntax("fd set start not [");
FD_ZERO(set);
if (vb2.buf[vb2.used] == ']') { vb2.used++; return; }
static void Pfdset(fd_set *set, int max) {
int r, c;
char *ep;
+
+ if (!set) {
+ Pstring("null","null fdset pointer");
+ return;
+ }
if (vb2.buf[vb2.used++] != hm_squote[hm_squote) Psyntax("fd set start not [");
FD_ZERO(set);