| | |
| | | #if defined(PRO_DE_SERIALIZE) |
| | | if (_input.proc_id != NULL) { |
| | | count = strlen(_input.proc_id) + 1; |
| | | min = count > MAX_STR_LEN ? MAX_STR_LEN : count; |
| | | min = count > (MAX_STR_LEN - 1) ? (MAX_STR_LEN - 1) : count; |
| | | strncpy(pData.proc_id, _input.proc_id, min); |
| | | } |
| | | |
| | | if (_input.name != NULL) { |
| | | count = strlen(_input.name) + 1; |
| | | min = count > MAX_STR_LEN ? MAX_STR_LEN : count; |
| | | min = count > (MAX_STR_LEN - 1)? (MAX_STR_LEN -1) : count; |
| | | strncpy(pData.name, _input.name, min); |
| | | } |
| | | |
| | | if (_input.public_info != NULL) { |
| | | count = strlen(_input.public_info) + 1; |
| | | min = count > MAX_STR_LEN ? MAX_STR_LEN : count; |
| | | min = count > (MAX_STR_LEN - 1)? (MAX_STR_LEN - 1) : count; |
| | | strncpy(pData.public_info, _input.public_info, min); |
| | | } |
| | | |
| | | if (_input.private_info != NULL) { |
| | | count = strlen(_input.private_info) + 1; |
| | | min = count > MAX_STR_LEN ? MAX_STR_LEN : count; |
| | | min = count > (MAX_STR_LEN - 1)? (MAX_STR_LEN - 1): count; |
| | | strncpy(pData.private_info, _input.private_info, min); |
| | | } |
| | | #else |
| | | if (strlen((const char *)(((ProcInfo *)proc_info)->proc_id)) > 0) { |
| | | count = strlen((const char *)(((ProcInfo *)proc_info)->proc_id)) + 1; |
| | | min = count > MAX_STR_LEN ? MAX_STR_LEN : count; |
| | | min = count > (MAX_STR_LEN - 1) ? (MAX_STR_LEN - 1): count; |
| | | strncpy(pData.proc_id, ((ProcInfo *)proc_info)->proc_id, min); |
| | | } |
| | | |
| | | if (strlen((const char *)(((ProcInfo *)proc_info)->name)) > 0) { |
| | | count = strlen((const char *)(((ProcInfo *)proc_info)->name)) + 1; |
| | | min = count > MAX_STR_LEN ? MAX_STR_LEN : count; |
| | | min = count > (MAX_STR_LEN - 1) ? (MAX_STR_LEN - 1) : count; |
| | | strncpy(pData.name, ((ProcInfo *)proc_info)->name, min); |
| | | } |
| | | |
| | | if (strlen((const char *)(((ProcInfo *)proc_info)->public_info)) > 0) { |
| | | count = strlen((const char *)(((ProcInfo *)proc_info)->public_info)) + 1; |
| | | min = count > MAX_STR_LEN ? MAX_STR_LEN : count; |
| | | min = count > (MAX_STR_LEN - 1) ? (MAX_STR_LEN - 1) : count; |
| | | strncpy(pData.public_info, ((ProcInfo *)proc_info)->public_info, min); |
| | | } |
| | | |
| | | if (strlen((const char *)(((ProcInfo *)proc_info)->private_info)) > 0) { |
| | | count = strlen((const char *)(((ProcInfo *)proc_info)->private_info)) + 1; |
| | | min = count > MAX_STR_LEN ? MAX_STR_LEN : count; |
| | | min = count > (MAX_STR_LEN - 1) ? (MAX_STR_LEN - 1) : count; |
| | | strncpy(pData.private_info, ((ProcInfo *)proc_info)->private_info, min); |
| | | } |
| | | #endif |