From: yellows8 Date: Sun, 2 Nov 2014 02:11:19 +0000 (-0400) Subject: Updated CheckNew3DS code. Now the out value is cleared first, then the out value... X-Git-Tag: v0.2.0~71^2~2 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=4e90fbb905f11dc20dc271a171328491aa6edc4f;p=corbenik%2Fctrulib.git Updated CheckNew3DS code. Now the out value is cleared first, then the out value is only set to the cmdreply data when ret is zero. --- diff --git a/libctru/source/services/apt.c b/libctru/source/services/apt.c index d13d15e..91e1c17 100644 --- a/libctru/source/services/apt.c +++ b/libctru/source/services/apt.c @@ -808,7 +808,11 @@ Result APT_CheckNew3DS_Application(Handle* handle, u8 *out) Result ret=0; if((ret=svcSendSyncRequest(*handle)))return ret; - if(out)*out=cmdbuf[2]; + if(out) + { + *out = 0; + if(ret==0)*out=cmdbuf[2]; + } return cmdbuf[1]; } @@ -823,7 +827,11 @@ Result APT_CheckNew3DS_System(Handle* handle, u8 *out) Result ret=0; if((ret=svcSendSyncRequest(*handle)))return ret; - if(out)*out=cmdbuf[2]; + if(out) + { + *out = 0; + if(ret==0)*out=cmdbuf[2]; + } return cmdbuf[1]; }