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:
Mukund Sivaraman 2008-06-10 09:51:23 +05:30
parent 5ea289d82e
commit 95c1f39f60

View File

@ -232,14 +232,15 @@ add_error_variable(struct conn_s *connptr, char *key, char *val)
hashmap_create(ERRVAR_BUCKETCOUNT)))
return (-1);
if (hashmap_insert(connptr->error_variables, key, val,
strlen(val) + 1) < 0)
return (-1);
return (0);
return hashmap_insert(connptr->error_variables, key, val,
strlen(val) + 1);
}
#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