Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Aug 2000 15:42:46 -0500 (CDT)
From:      toasty@dragondata.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/20538: Segfault in ports/devel/cutils cobfusc
Message-ID:  <200008112042.PAA90513@shell1.dragondata.com>

next in thread | raw e-mail | index | archive | help

>Number:         20538
>Category:       ports
>Synopsis:       Segfault in ports/devel/cutils cobfusc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 11 13:50:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Kevin Day
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
DragonData Internet Services
>Environment:

cobfusc in any system after 3.0(?)

>Description:

I can't exactly figure out why this worked on my 2.2.8 system but doesn't
now. My only guess is that toupper() and tolower() were implemented
differently.

>How-To-Repeat:

cobfusc -c lower cobfusc.c

>Fix:

--- cobfusc.c.orig	Wed Mar 26 07:58:16 1997
+++ cobfusc.c	Fri Aug 11 15:36:09 2000
@@ -342,25 +342,31 @@
 		/*
 		 * Convert the string to uppercase.
 		 */
-		while (*p)
-			*p = toupper(*p++);
+		while (*p) {
+			*p = toupper(*p);
+			p++;
+		}
 		break;
 	case 2:
 		/*
 		 * Convert the string to lowercase.
 		 */
-		while (*p)
-			*p = tolower(*p++);
+		while (*p) {
+			*p = tolower(*p);
+			p++;
+		}
 		break;
 	default:
 		/*
 		 * Convert the string to random case.
 		 */
-		while (*p)
+		while (*p) {
 			if (RANDOM(2) == 1)
-				*p = toupper(*p++);
+				*p = toupper(*p);
 			else
-				*p = tolower(*p++);
+				*p = tolower(*p);
+			p++;
+		}
 	}
 
 	return buf;

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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