Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Aug 2013 11:25:42 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254486 - head/usr.sbin/rwhod
Message-ID:  <201308181125.r7IBPhLV048702@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sun Aug 18 11:25:42 2013
New Revision: 254486
URL: http://svnweb.freebsd.org/changeset/base/254486

Log:
  Cast argument of is*() ctype functions to unsigned char.
  
  Without the cast there is ambiguity between 0xFF and -1 (EOF).
  
  Suggested by:	jilles
  Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
  Sponsored by:	Google Summer of Code 2013

Modified:
  head/usr.sbin/rwhod/rwhod.c

Modified: head/usr.sbin/rwhod/rwhod.c
==============================================================================
--- head/usr.sbin/rwhod/rwhod.c	Sun Aug 18 10:44:37 2013	(r254485)
+++ head/usr.sbin/rwhod/rwhod.c	Sun Aug 18 11:25:42 2013	(r254486)
@@ -337,8 +337,11 @@ verify(char *name, int maxlen)
 
 	size = 0;
 	while (*name != '\0' && size < maxlen - 1) {
-		if (!isascii(*name) || !(isalnum(*name) || ispunct(*name)))
+		if (!isascii((unsigned char)*name) ||
+		    !(isalnum((unsigned char)*name) ||
+		    ispunct((unsigned char)*name))) {
 			return (0);
+		}
 		name++;
 		size++;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308181125.r7IBPhLV048702>