Changeset e37e8504 in rtems
- Timestamp:
- 12/01/14 03:53:55 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- dd309b1
- Parents:
- d006b46d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libmisc/shell/main_edit.c
rd006b46d re37e8504 219 219 int untitled; // Counter for untitled files 220 220 }; 221 222 /*223 * This is a hack to allow a simple way to inspect the keys to224 * add extar decoding. It is not multi-user safe.225 */226 #define KEY_HISTORY 1227 #if KEY_HISTORY228 int key_history[32];229 size_t key_history_in;230 #endif231 221 232 222 // … … 814 804 { 815 805 int ch = getchar(); 816 #if KEY_HISTORY817 if (key_history_in < sizeof(key_history)) {818 key_history[key_history_in++] = ch;819 #if defined(__rtems__)820 } if (key_history_in > sizeof(key_history)) {821 /* eliminate possibility of using index above array bounds */822 assert( key_history_in > sizeof(key_history));823 #endif824 } else {825 memmove(&key_history[0], &key_history[1], sizeof(key_history) - sizeof(key_history[0]));826 key_history[key_history_in - 1] = ch;827 }828 #endif829 806 return ch; 830 807 } … … 2156 2133 #if defined(__rtems__) 2157 2134 /* 2158 * Coverity spotted this as using ed after free() so changing 2135 * Coverity spotted this as using ed after free() so changing 2159 2136 * the order of the statements. 2160 2137 */
Note: See TracChangeset
for help on using the changeset viewer.