s a f e _ s t r n c p y Done exclusively because in legacy mode, safe_interpret cannot fill the string up to the end by calling strncpy.
| 1039 | // Done exclusively because in legacy mode, safe_interpret cannot fill the |
| 1040 | // string up to the end by calling strncpy. |
| 1041 | static void safe_strncpy(char* target, const char* source, size_t bs) |
| 1042 | { |
| 1043 | if (!bs) |
| 1044 | return; |
| 1045 | |
| 1046 | for (--bs; bs > 0 && *source; --bs) |
| 1047 | *target++ = *source++; |
| 1048 | |
| 1049 | *target = 0; |
| 1050 | } |
| 1051 | |
| 1052 | |
| 1053 | // CVC: This special function for ADA has been restored to non-const vector, |