From 4e90fbb905f11dc20dc271a171328491aa6edc4f Mon Sep 17 00:00:00 2001 From: yellows8 Date: Sat, 1 Nov 2014 22:11:19 -0400 Subject: [PATCH] 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. --- libctru/source/services/apt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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]; }