Changeset 3613 for trunk/util/nvramtool/cmos_ops.c
- Timestamp:
- 09/27/08 12:08:28 (3 months ago)
- Files:
-
- 1 modified
-
trunk/util/nvramtool/cmos_ops.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/util/nvramtool/cmos_ops.c
r3122 r3613 1 1 /*****************************************************************************\ 2 2 * cmos_ops.c 3 * $Id$4 3 ***************************************************************************** 5 4 * Copyright (C) 2002-2005 The Regents of the University of California. … … 48 47 return CMOS_OP_RESERVED; 49 48 50 if ((result = verify_cmos_op(e->bit, e->length )) != OK)49 if ((result = verify_cmos_op(e->bit, e->length, e->config)) != OK) 51 50 return result; 52 51 … … 71 70 { case CMOS_ENTRY_ENUM: 72 71 case CMOS_ENTRY_HEX: 72 case CMOS_ENTRY_STRING: 73 73 break; 74 74 … … 93 93 unsigned long long out; 94 94 const char *p; 95 char *memory; 95 96 int negative, result, found_one; 96 97 … … 140 141 break; 141 142 143 case CMOS_ENTRY_STRING: 144 if (e->length < (8 * strlen(value_str))) 145 return CMOS_OP_VALUE_TOO_WIDE; 146 memory = malloc(e->length / 8); 147 memset(memory, 0, e->length / 8); 148 strcpy(memory, value_str); 149 out = (unsigned long)memory; 150 break; 151 142 152 default: 143 153 BUG();
