Merge branch 'V5-6-patches' into V5-7-patches

* V5-6-patches:
  swinst_apt: ensure room for string terminator
  mta_sendmail: isspace cannot take a char argument
  expExpressionConf, expValue: isspace cannot take a char argument.
diff --git a/agent/mibgroup/disman/expr/expExpressionConf.c b/agent/mibgroup/disman/expr/expExpressionConf.c
index 5c08c72..826d679 100644
--- a/agent/mibgroup/disman/expr/expExpressionConf.c
+++ b/agent/mibgroup/disman/expr/expExpressionConf.c
@@ -140,7 +140,7 @@
          * object name into the expression field...
          */
         /*   XXX - TODO - Handle string literals */
-        if (!isalpha(*cp)) {
+        if (!isalpha(*cp & 0xFF)) {
            *cp2++ = *cp++;
            continue;
         }
diff --git a/agent/mibgroup/disman/expr/expValue.c b/agent/mibgroup/disman/expr/expValue.c
index 46638f2..eeff402 100644
--- a/agent/mibgroup/disman/expr/expValue.c
+++ b/agent/mibgroup/disman/expr/expValue.c
@@ -230,7 +230,7 @@
 
     n = atoi(start);
     for (cp=start; *cp; cp++)
-        if (!isdigit(*cp))
+        if (!isdigit(*cp & 0xFF))
             break;
     *end = cp;
     return n;
@@ -565,7 +565,7 @@
             break;
 
         default:
-            if (isalpha( *cp1 )) {
+            if (isalpha( *cp1 & 0xFF )) {
                 /*
                  * Unrecognised function call ?
                  */
@@ -576,7 +576,7 @@
                 var->data = (void *)(cp1 - exprRaw);
                 return var;
             }
-            else if (!isspace( *cp1 )) {
+            else if (!isspace( *cp1 & 0xFF )) {
                 /*
                  * Unrecognised operator ?
                  */
diff --git a/agent/mibgroup/host/data_access/swinst_apt.c b/agent/mibgroup/host/data_access/swinst_apt.c
index 8035a90..8b37b45 100644
--- a/agent/mibgroup/host/data_access/swinst_apt.c
+++ b/agent/mibgroup/host/data_access/swinst_apt.c
@@ -39,8 +39,8 @@
 {
     strlcpy(pkg_directory, "/var/lib/dpkg/info", sizeof(pkg_directory));
     snprintf(apt_fmt, SNMP_MAXBUF, "%%%d[^#]#%%%d[^#]#%%%d[^#]#%%%d[^#]#%%%d[^#]#%%%ds",
-	SNMP_MAXBUF, SNMP_MAXBUF, SNMP_MAXBUF,
-	SNMP_MAXBUF, SNMP_MAXBUF, SNMP_MAXBUF);
+	SNMP_MAXBUF-1, SNMP_MAXBUF-1, SNMP_MAXBUF-1,
+	SNMP_MAXBUF-1, SNMP_MAXBUF-1, SNMP_MAXBUF-1);
 }
 
 void
diff --git a/agent/mibgroup/mibII/mta_sendmail.c b/agent/mibgroup/mibII/mta_sendmail.c
index 00397d3..c1edd07 100644
--- a/agent/mibgroup/mibII/mta_sendmail.c
+++ b/agent/mibgroup/mibII/mta_sendmail.c
@@ -754,7 +754,7 @@
 
             if (mailers < MAXMAILERS) {
                 for (i = 1;
-                     line[i] != ',' && !isspace(line[i]) && line[i] != '\0'
+                     line[i] != ',' && !isspace(line[i] & 0xFF) && line[i] != '\0'
                      && i <= MNAMELEN; i++) {
                     mailernames[mailers][i - 1] = line[i];
                 }
@@ -1025,7 +1025,7 @@
     }
 
     if (strcasecmp(token, "sendmail_stats") == 0) {
-        while (isspace(*line)) {
+        while (isspace(*line & 0xFF)) {
             line++;
         }
         copy_nword(line, sendmailst_fn, sizeof(sendmailst_fn));
@@ -1041,7 +1041,7 @@
                     "opened statistics file \"%s\"\n", sendmailst_fn));
         return;
     } else if (strcasecmp(token, "sendmail_config") == 0) {
-        while (isspace(*line)) {
+        while (isspace(*line & 0xFF)) {
             line++;
         }
         copy_nword(line, sendmailcf_fn, sizeof(sendmailcf_fn));
@@ -1052,14 +1052,14 @@
                     "read config file \"%s\"\n", sendmailcf_fn));
         return;
     } else if (strcasecmp(token, "sendmail_queue") == 0) {
-        while (isspace(*line)) {
+        while (isspace(*line & 0xFF)) {
             line++;
         }
         add_queuegroup("mqueue", line);
 
         return;
     } else if (strcasecmp(token, "sendmail_index") == 0) {
-        while (isspace(*line)) {
+        while (isspace(*line & 0xFF)) {
             line++;
         }
         applindex = atol(line);
@@ -1068,7 +1068,7 @@
             applindex = 1;
         }
     } else if (strcasecmp(token, "sendmail_stats_t") == 0) {
-        while (isspace(*line)) {
+        while (isspace(*line & 0xFF)) {
             line++;
         }
         stat_cache_time = atol(line);
@@ -1077,7 +1077,7 @@
             applindex = 5;
         }
     } else if (strcasecmp(token, "sendmail_queue_t") == 0) {
-        while (isspace(*line)) {
+        while (isspace(*line & 0xFF)) {
             line++;
         }
         dir_cache_time = atol(line);