Index: libsm/memcmp.c
===================================================================
--- libsm/memcmp.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/memcmp.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -18,5 +18,5 @@
 	if (cp1 != cp2)
 		while (--n >= 0)
-			if (diff = *cp1++ - *cp2++)
+			if ((diff = *cp1++ - *cp2++))
 				return(diff);
 
Index: libsm/memcmpu.c
===================================================================
--- libsm/memcmpu.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/memcmpu.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -20,8 +20,8 @@
 
 		if (isascii(c1) && islower(c1))
-			c1 = _toupper(c1);
+			c1 = (int8_t)_toupper(c1);
 
 		if (isascii(c2) && islower(c2))
-			c2 = _toupper(c2);
+			c2 = (int8_t)_toupper(c2);
 
 		if (c1 < c2)
Index: libsm/str2lc.c
===================================================================
--- libsm/str2lc.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/str2lc.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -13,6 +13,6 @@
 	register int8_t *r = s;
 
-	while (c = *s)
-		*s++ = tolower(c);
+	while ((c = *s))
+		*s++ = (int8_t)tolower(c);
 
 	return(r);
Index: libsm/str2uc.c
===================================================================
--- libsm/str2uc.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/str2uc.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -13,6 +13,6 @@
 	register int8_t *r = s;
 
-	while (c = *s)
-		*s++ = toupper(c);
+	while ((c = *s))
+		*s++ = (int8_t)toupper(c);
 
 	return(r);
Index: libsm/strcat.c
===================================================================
--- libsm/strcat.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/strcat.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -17,10 +17,10 @@
 	os1 = s1;
 
-	while(*s1++)
+	while (*s1++)
 		;
 
 	--s1;
 
-	while(*s1++ = *s2++)
+	while ((*s1++ = *s2++))
 		;
 
Index: libsm/strcpy.c
===================================================================
--- libsm/strcpy.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/strcpy.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -17,5 +17,5 @@
 	os1 = s1;
 
-	while(*s1++ = *s2++)
+	while ((*s1++ = *s2++))
 		;
 
Index: libsm/strltrm.c
===================================================================
--- libsm/strltrm.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/strltrm.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -24,5 +24,5 @@
 		++rp;
 
-	while (c = *rp++)
+	while ((c = *rp++))
 		*lp++ = c;
 
Index: libsm/strncat.c
===================================================================
--- libsm/strncat.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/strncat.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -18,10 +18,10 @@
 	os1 = s1;
 
-	while(*s1++)
+	while (*s1++)
 		;
 
 	--s1;
 
-	while(*s1++ = *s2++)
+	while ((*s1++ = *s2++))
 		if(--n < 0) {
 
Index: libsm/strtol.c
===================================================================
--- libsm/strtol.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
+++ libsm/strtol.c	(revision d18a473a1bebff676a7815ea3902d5de01a2a884)
@@ -39,5 +39,5 @@
 	}
 
-	if (base == 0)
+	if (base == 0) {
 		if (c != '0')
 			base = 10;
@@ -46,4 +46,6 @@
 		else
 			base = 8;
+	}
+
 	/*
 		for any base > 10, the digits incrementally following
