r24280 by jghali - Rewrite #16340 fix without using platform dependent functions
scribus-commit
scribus-commit at lists.scribus.net
Mon Nov 23 14:12:09 UTC 2020
Author: jghali
Date: Mon Nov 23 14:12:09 2020
New Revision: 24280
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24280
Log:
Rewrite #16340 fix without using platform dependent functions
Modified:
trunk/Scribus/scribus/fpointarray.cpp
Modified: trunk/Scribus/scribus/fpointarray.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24280&path=/trunk/Scribus/scribus/fpointarray.cpp
==============================================================================
--- trunk/Scribus/scribus/fpointarray.cpp (original)
+++ trunk/Scribus/scribus/fpointarray.cpp Mon Nov 23 14:12:09 2020
@@ -28,7 +28,6 @@
#define _USE_MATH_DEFINES
#endif
#include <cmath>
-#include <cstring>
#include <QRegExp>
#include <QVector>
@@ -854,16 +853,15 @@
// Check for nan value
if (*ptr == 'n' || *ptr == 'N')
{
-#if defined(Q_OS_WIN)
- bool isNan = (_strnicmp(ptr, "nan", 3) == 0);
-#else
- bool isNan = (strncasecmp(ptr, "nan", 3) == 0);
-#endif
- if (isNan)
- {
- const char* tmpPtr = ptr + 3;
- isNan &= (*tmpPtr == ' ' || *tmpPtr == '\0');
- }
+ bool isNan = true;
+ const char *tmpPtr = ptr + 1;
+ isNan &= (*tmpPtr == 'a' || *tmpPtr == 'A');
+ if (*tmpPtr != '\0')
+ ++tmpPtr;
+ isNan &= (*tmpPtr == 'n' || *tmpPtr == 'N');
+ if (*tmpPtr != '\0')
+ ++tmpPtr;
+ isNan &= (*tmpPtr == ' ' || *tmpPtr == '\0');
if (isNan)
{
number = 0.0;
More information about the scribus-commit
mailing list