summaryrefslogtreecommitdiff
path: root/cesar/host/fcall/src/fcall.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/host/fcall/src/fcall.c')
-rw-r--r--cesar/host/fcall/src/fcall.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cesar/host/fcall/src/fcall.c b/cesar/host/fcall/src/fcall.c
index 0719f8261f..57634449ef 100644
--- a/cesar/host/fcall/src/fcall.c
+++ b/cesar/host/fcall/src/fcall.c
@@ -155,7 +155,7 @@ int fcall_fill_hdr(
errno = EINVAL;
return -1;
}
-
+
param->id[FUNCTION_CALL_ID_MAX_SIZE - 1] = '\0'; /* just for security */
/* add the function id */
if(sci_msg_push(msg, strlen(param->id) + 1) < (int)strlen(param->id) + 1)
@@ -165,7 +165,7 @@ int fcall_fill_hdr(
return -1;
}
memcpy(msg->data_begin, param->id, strlen(param->id) + 1);
-
+
/* add fcall header */
if(sci_msg_push(msg, sizeof(struct fcall_msg_hdr)) < (int)sizeof(struct fcall_msg_hdr))
{
@@ -180,7 +180,7 @@ int fcall_fill_hdr(
msg->hdr.fcall->param_nb = param->param_nb;
msg->hdr.fcall->msg_id = htons(param->msg_id);
msg->hdr.fcall->flags = flags;
-
+
return 0;
}
@@ -421,6 +421,9 @@ int fcall_recv(sci_msg_t *msg, void *fcall_data)
return -1;
}
+ /* RESET THE MESSAGE DATA BEGIN POINTER!!! */
+ msg->data_begin = msg->data_end;
+
/* call the function */
station_log(fcall->sci->station, STATION_LOG_INFO, STATION_LOGTYPE_FCALL,
"%s calling function '%s'(%p) with %d parameters",