diff options
author | bde <bde@FreeBSD.org> | 1996-08-31 16:52:44 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-08-31 16:52:44 +0000 |
commit | 070eb30ca675029e79f93333b60287527efc0906 (patch) | |
tree | d0ca99d3f53a0fe4ea60e83d05baa8825fdd8cc4 /sys/libkern/strncmp.c | |
parent | db0af2c4dc8e05c93d178bf31653024d244398bb (diff) | |
download | FreeBSD-src-070eb30ca675029e79f93333b60287527efc0906.zip FreeBSD-src-070eb30ca675029e79f93333b60287527efc0906.tar.gz |
Fixed the easy cases of const poisoning in the kernel. Cosmetic.
Diffstat (limited to 'sys/libkern/strncmp.c')
-rw-r--r-- | sys/libkern/strncmp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/libkern/strncmp.c b/sys/libkern/strncmp.c index f209e54..e3c4327 100644 --- a/sys/libkern/strncmp.c +++ b/sys/libkern/strncmp.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: strncmp.c,v 1.2 1996/08/28 20:32:21 bde Exp $ */ #include <sys/cdefs.h> @@ -46,7 +46,8 @@ strncmp(s1, s2, n) return (0); do { if (*s1 != *s2++) - return (*(unsigned char *)s1 - *(unsigned char *)--s2); + return (*(const unsigned char *)s1 - + *(const unsigned char *)(s2 - 1)); if (*s1++ == 0) break; } while (--n != 0); |