From 02f41b1a7425fc68f67ea7e1d2c804c753171a99 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 29 Dec 2018 00:39:58 +0100 Subject: [PATCH] app_server: Cleanup argument checks to use boolean expressions. --- src/servers/app/ServerFont.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/servers/app/ServerFont.cpp b/src/servers/app/ServerFont.cpp index a045ace457..fab502af5b 100644 --- a/src/servers/app/ServerFont.cpp +++ b/src/servers/app/ServerFont.cpp @@ -832,8 +832,10 @@ ServerFont::GetEscapements(const char* string, int32 numBytes, int32 numChars, escapement_delta delta, BPoint escapementArray[], BPoint offsetArray[]) const { - if (!string || numBytes <= 0 || !escapementArray) + if (string == NULL || numBytes <= 0 || numChars <= 0 + || escapementArray == NULL) { return B_BAD_DATA; + } BPointEscapementConsumer consumer(escapementArray, offsetArray, fSize); if (GlyphLayoutEngine::LayoutGlyphs(consumer, *this, string, numBytes, @@ -881,7 +883,7 @@ status_t ServerFont::GetEscapements(const char* string, int32 numBytes, int32 numChars, escapement_delta delta, float widthArray[]) const { - if (!string || numBytes <= 0 || !widthArray) + if (string == NULL || numBytes <= 0 || numChars <= 0 || widthArray == NULL) return B_BAD_DATA; WidthEscapementConsumer consumer(widthArray, fSize); @@ -1011,8 +1013,10 @@ ServerFont::GetBoundingBoxesForStrings(char *charArray[], size_t lengthArray[], escapement_delta deltaArray[]) { // TODO: The font_metric_mode is never used - if (!charArray || !lengthArray|| numStrings <= 0 || !rectArray || !deltaArray) + if (charArray == NULL || lengthArray == NULL || numStrings <= 0 + || rectArray == NULL || deltaArray == NULL) { return B_BAD_DATA; + } Transformable transform(EmbeddedTransformation());