diff --git a/src/ioc/dbStatic/dbStaticLib.c b/src/ioc/dbStatic/dbStaticLib.c index e1af4c720..18221af0b 100644 --- a/src/ioc/dbStatic/dbStaticLib.c +++ b/src/ioc/dbStatic/dbStaticLib.c @@ -48,7 +48,7 @@ int dbStaticDebug = 0; static char *pNullString = ""; #define messagesize 100 -#define RPCL_LEN 184 +#define RPCL_LEN INFIX_TO_POSTFIX_SIZE(80) static char *ppstring[5]={"NPP","PP","CA","CP","CPP"}; static char *msstring[4]={"NMS","MS","MSI","MSS"}; diff --git a/src/libCom/misc/epicsString.c b/src/libCom/misc/epicsString.c index de38005b4..7a63580a2 100644 --- a/src/libCom/misc/epicsString.c +++ b/src/libCom/misc/epicsString.c @@ -100,7 +100,7 @@ int epicsStrnRawFromEscaped(char *dst, size_t dstlen, const char *src, { /* \xXXX... */ unsigned int u = 0; - if (!srclen-- || !(c = *src++)) + if (!srclen-- || !(c = *src++ & 0xff)) goto done; while (isxdigit(c)) { @@ -108,7 +108,7 @@ int epicsStrnRawFromEscaped(char *dst, size_t dstlen, const char *src, if (u > 0xff) { /* Undefined behaviour! */ } - if (!srclen-- || !(c = *src++)) { + if (!srclen-- || !(c = *src++ & 0xff)) { OUT(u); goto done; } @@ -153,7 +153,7 @@ int epicsStrnEscapedFromRaw(char *dst, size_t dstlen, const char *src, case '\'': OUT('\\'); OUT('\''); break; case '\"': OUT('\\'); OUT('\"'); break; default: - if (isprint(c)) { + if (isprint(c & 0xff)) { OUT(c); break; } @@ -183,7 +183,7 @@ size_t epicsStrnEscapedFromRawSize(const char *src, size_t srclen) ndst++; break; default: - if (!isprint(c)) + if (!isprint(c & 0xff)) ndst += 3; } } @@ -247,7 +247,7 @@ int epicsStrPrintEscaped(FILE *fp, const char *s, size_t len) case '\'': nout += fprintf(fp, "\\'"); break; case '\"': nout += fprintf(fp, "\\\""); break; default: - if (isprint((int)c)) + if (isprint(0xff & (int)c)) nout += fprintf(fp, "%c", c); else nout += fprintf(fp, "\\%03o", (unsigned char)c); diff --git a/src/libCom/test/epicsCalcTest.cpp b/src/libCom/test/epicsCalcTest.cpp index 694a62d58..92ec61a37 100644 --- a/src/libCom/test/epicsCalcTest.cpp +++ b/src/libCom/test/epicsCalcTest.cpp @@ -553,10 +553,18 @@ MAIN(epicsCalcTest) testExpr(0.0 + NaN); testExpr(Inf + 0.0); testExpr(Inf + Inf); +#if defined(_WIN64) && defined(_MSC_VER) + testCalc("Inf + -Inf", NaN); +#else testExpr(Inf + -Inf); +#endif testExpr(Inf + NaN); testExpr(-Inf + 0.0); +#if defined(_WIN64) && defined(_MSC_VER) + testCalc("-Inf + Inf", NaN); +#else testExpr(-Inf + Inf); +#endif testExpr(-Inf + -Inf); testExpr(-Inf + NaN); testExpr(NaN + 0.0);