| 5000 | |
| 5001 | |
| 5002 | inline LPTSTR Script::ParseActionType(LPTSTR aBufTarget, LPTSTR aBufSource, bool aDisplayErrors) |
| 5003 | // inline since it's called so often. |
| 5004 | // aBufTarget should be at least MAX_VAR_NAME_LENGTH + 1 in size. |
| 5005 | // Returns NULL if it's not a named action; otherwise, the address of the first |
| 5006 | // character after the action name in aBufSource (possibly the null-terminator). |
| 5007 | { |
| 5008 | //////////////////////////////////////////////////////// |
| 5009 | // Find the action name and the start of the param list. |
| 5010 | //////////////////////////////////////////////////////// |
| 5011 | LPTSTR end_marker = find_identifier_end(aBufSource); |
| 5012 | size_t action_name_length = end_marker - aBufSource; |
| 5013 | if (!action_name_length || action_name_length > MAX_VAR_NAME_LENGTH) |
| 5014 | { |
| 5015 | // For the "too long" case, it will ultimately be treated as an unrecognized action. |
| 5016 | *aBufTarget = '\0'; |
| 5017 | return NULL; |
| 5018 | } |
| 5019 | tcslcpy(aBufTarget, aBufSource, action_name_length + 1); |
| 5020 | return end_marker; |
| 5021 | } |
| 5022 | |
| 5023 | |
| 5024 |
nothing calls this directly
no test coverage detected