Fix two backwards tests.

CID: 1365227, 1365228
This commit is contained in:
Warner Losh 2016-10-25 19:04:44 +00:00
parent c1e27128f8
commit dbef2d4941
2 changed files with 4 additions and 47 deletions

View File

@ -1,43 +0,0 @@
# $FreeBSD$
# Common flags to build FICL related files
FICLDIR?= ${SRCTOP}/sys/boot/ficl
.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
FICL_CPUARCH= i386
.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el"
FICL_CPUARCH= mips64
.else
FICL_CPUARCH= ${MACHINE_CPUARCH}
.endif
.PATH: ${FICLDIR} ${FICLDIR}/${FICL_CPUARCH}
.if ${MACHINE_CPUARCH} == "amd64"
.if defined(FICL32)
CFLAGS+= -m32 -I.
.else
CFLAGS+= -fPIC
.endif
.endif
.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+= -m32 -mcpu=powerpc -I.
.endif
CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \
-I${FICLDIR}/../common
.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
.if !exists(machine)
${SRCS:M*.c:R:S/$/.o/g}: machine
beforedepend ${OBJS}: machine
.endif
machine: .NOMETA
ln -sf ${.CURDIR}/../../i386/include machine
CLEANFILES+= machine
.endif

View File

@ -114,7 +114,7 @@ ficlEfiSetenv(FICL_VM *pVM)
#ifndef TESTMAIN
guid = (char*)ficlMalloc(guids);
if (guid != NULL)
if (guid == NULL)
vmThrowErr(pVM, "Error: out of memory");
memcpy(guid, guidp, guids);
uuid_from_string(guid, &u, &ustatus);
@ -131,7 +131,7 @@ ficlEfiSetenv(FICL_VM *pVM)
name[names] = (CHAR16)0;
value = (char*)ficlMalloc(values + 1);
if (value != NULL)
if (value == NULL)
vmThrowErr(pVM, "Error: out of memory");
memcpy(value, valuep, values);
@ -166,7 +166,7 @@ ficlEfiGetenv(FICL_VM *pVM)
#ifndef TESTMAIN
name = (char*) ficlMalloc(names+1);
if (!name)
if (name == NULL)
vmThrowErr(pVM, "Error: out of memory");
strncpy(name, namep, names);
name[names] = '\0';
@ -201,7 +201,7 @@ ficlEfiUnsetenv(FICL_VM *pVM)
#ifndef TESTMAIN
name = (char*) ficlMalloc(names+1);
if (!name)
if (name == NULL)
vmThrowErr(pVM, "Error: out of memory");
strncpy(name, namep, names);
name[names] = '\0';