X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=AcessNative%2Facesskernel_src%2Fsyscalls.c;h=ae2c92c366f9bda50baa74839ee9c908f888edfd;hb=876d0f8bb916e9c56d0e6bda7703c459129f0f5e;hp=4194a36acc235ef9f567ddfb7ad35bb70d3e8b16;hpb=e7a76b0d8a0cc6aa77966509780973a6f8216ef7;p=tpg%2Facess2.git diff --git a/AcessNative/acesskernel_src/syscalls.c b/AcessNative/acesskernel_src/syscalls.c index 4194a36a..ae2c92c3 100644 --- a/AcessNative/acesskernel_src/syscalls.c +++ b/AcessNative/acesskernel_src/syscalls.c @@ -277,12 +277,12 @@ const int ciNumSyscalls = sizeof(caSyscalls)/sizeof(caSyscalls[0]); /** * \brief Recieve a syscall structure from the server code */ -tRequestHeader *SyscallRecieve(tRequestHeader *Request, int *ReturnLength) +tRequestHeader *SyscallRecieve(tRequestHeader *Request, size_t *ReturnLength) { char formatString[Request->NParams+1]; char *inData = (char*)&Request->Params[Request->NParams]; int argListLen = 0; - int i, retVal; + int retVal; tRequestHeader *ret; int retValueCount; int retDataLen; @@ -309,7 +309,7 @@ tRequestHeader *SyscallRecieve(tRequestHeader *Request, int *ReturnLength) retDataLen = sizeof(Uint64) + sizeof(Uint32); // Get size of argument list - for( i = 0; i < Request->NParams; i ++ ) + for( int i = 0; i < Request->NParams; i ++ ) { argSizes[i] = Request->Params[i].Length; switch(Request->Params[i].Type) @@ -344,7 +344,7 @@ tRequestHeader *SyscallRecieve(tRequestHeader *Request, int *ReturnLength) return NULL; // ERROR! } } - formatString[i] = '\0'; + formatString[Request->NParams] = '\0'; LOG("Request %i(%s) '%s'", Request->CallID, casSYSCALL_NAMES[Request->CallID], formatString); @@ -352,7 +352,7 @@ tRequestHeader *SyscallRecieve(tRequestHeader *Request, int *ReturnLength) char argListData[argListLen]; argListLen = 0; // Build argument list - for( i = 0; i < Request->NParams; i ++ ) + for( int i = 0; i < Request->NParams; i ++ ) { returnData[i] = NULL; switch(Request->Params[i].Type) @@ -449,7 +449,7 @@ tRequestHeader *SyscallRecieve(tRequestHeader *Request, int *ReturnLength) //Log_Debug("Syscalls", "Return 0x%llx", retVal); retValueCount = 2; - for( i = 0; i < Request->NParams; i ++ ) + for( int i = 0; i < Request->NParams; i ++ ) { if( Request->Params[i].Type != ARG_TYPE_DATA ) continue; if( !(Request->Params[i].Flags & ARG_FLAG_RETURN) ) continue;