/* Returns 0 on success, -1 of failure (new string too long).  */
int eeprom_field_update_ascii(struct eeprom_field *field, char *value)
/* Returns 0 on success, -1 of failure (new string too long).  */
int eeprom_field_update_ascii(struct eeprom_field *field, char *value)
{
	if (strlen(value) >= field->size) {
		printf("%s: new data too long\n", field->name);
		return -1;
	}
	strncpy((char *)field->buf, value, field->size - 1);
	field->buf[field->size - 1] = '\0';
	return 0;
}