So i have a function which reads in 3 arguements. This runction reads a string from the queue specified by the first arguement. The first one is the number of a queue, which is not a problem. I just access that queue. The second arguement is a pointer to a char array, which i should be putting the read string into. The third is a pointer to an int, which i need to put the length of the read string into.
[CODE]int MboxRecv(mbox_t handle,int* length, char* msg)
//there is a check here that confirms that the message in the queue is correct
workingindex = queue->currentindex;
len = the length of string contained in queue;
msg[i] = (&theBox[handle])->buffer[workingindex+i];
//here id use strncpy, but i cant import string.h cause its a weird c distro.
//strncpy(msg, (&theBox[handle])->buffer, len);
//here there is another check, confirms that it DID in fact write to msg appropriately.
so, the problem is, once out of the function, only the first char is written. If the string is length 10, inside the function all 10 are written, outside, only the first is correct, the rest are nulls when checked with indexing.