Now we support NVRAM whatever its size is.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 46262
static nvram_tuple_t * _nvram_realloc( nvram_handle_t *h, nvram_tuple_t *t,
const char *name, const char *value )
{
- if ((strlen(value) + 1) > NVRAM_SPACE)
+ if ((strlen(value) + 1) > h->length - h->offset)
return NULL;
if (!t) {
header = nvram_header(h);
if (header->magic == NVRAM_MAGIC &&
- (rdonly || header->len < NVRAM_SPACE)) {
+ (rdonly || header->len < h->length - h->offset)) {
_nvram_rehash(h);
free(mtd);
return h;
/* NVRAM constants */
#define NVRAM_MIN_SPACE 0x8000
-#define NVRAM_SPACE 0x10000
#define NVRAM_MAGIC 0x48534C46 /* 'FLSH' */
#define NVRAM_VERSION 1