Don't check the value to be inserted as it's already checked
This change primarily avoids a gcc warning where timebuf is never non-NULL. There is no need to check the value to be inserted as it's checked inside hashmap_insert(). This changeset also lets error return values from hashmap_insert() propogate instead of clamping them to -1 (not that these are currently used anyway).
This commit is contained in:
parent
5ea289d82e
commit
95c1f39f60
@ -232,14 +232,15 @@ add_error_variable(struct conn_s *connptr, char *key, char *val)
|
|||||||
hashmap_create(ERRVAR_BUCKETCOUNT)))
|
hashmap_create(ERRVAR_BUCKETCOUNT)))
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
if (hashmap_insert(connptr->error_variables, key, val,
|
return hashmap_insert(connptr->error_variables, key, val,
|
||||||
strlen(val) + 1) < 0)
|
strlen(val) + 1);
|
||||||
return (-1);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ADD_VAR_RET(x, y) if(y) { if(add_error_variable(connptr, x, y) == -1) return(-1); }
|
#define ADD_VAR_RET(x, y) \
|
||||||
|
do { \
|
||||||
|
if (add_error_variable(connptr, x, y) < 0) \
|
||||||
|
return -1; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set some standard variables used by all HTML pages
|
* Set some standard variables used by all HTML pages
|
||||||
|
Loading…
Reference in New Issue
Block a user