/* Make a copy, and uppercase that copy */
I = 0;
- while (Ident[I]) {
+ while (Ident[I] != '\0') {
+ /* If the identifier is longer than the longest mnemonic, it cannot
+ * be one.
+ */
+ if (I >= sizeof (Key) - 1) {
+ /* Not found, no need for further action */
+ return -1;
+ }
Key[I] = toupper ((unsigned char)Ident[I]);
++I;
}
/* Description for one instruction */
typedef struct InsDesc InsDesc;
struct InsDesc {
- char Mnemonic [8];
+ char Mnemonic[5];
unsigned long AddrMode; /* Valid adressing modes */
unsigned char BaseCode; /* Base opcode */
unsigned char ExtCode; /* Number of ext code table */