- /* FIXME: put a bound prefix on the %s to prevent buffer overflow */
- int word_count = sscanf(raw, "%s%s", cmd->raw1, cmd->raw2);
-
- // make space for substrings and zero it out
- char chunk_data[][TOKLEN+1] = {
- {"\0\0\0\0\0"},
- {"\0\0\0\0\0"},
- {"\0\0\0\0\0"},
- {"\0\0\0\0\0"},
- };
-
- // break the words into up to 4 5-char substrings
- sscanf(cmd->raw1, "%5s%5s", chunk_data[0], chunk_data[1]);
- if (word_count == 2)
- sscanf(cmd->raw2, "%5s%5s", chunk_data[2], chunk_data[3]);
-
- // uppercase all the substrings
- for (int i = 0; i < 4; ++i)
- for (unsigned int j = 0; j < strlen(chunk_data[i]); ++j)
- chunk_data[i][j] = (char) toupper(chunk_data[i][j]);
+ /* Bound prefix on the %s would be needed to prevent buffer
+ * overflow. but we shortstop this more simply by making each
+ * raw-input buffer as long as the enrire inout buffer. */
+ sscanf(raw, "%s%s", cmd->raw1, cmd->raw2);