Module Name:    src
Committed By:   joerg
Date:           Tue Oct 29 16:19:59 UTC 2019

Modified Files:
        src/bin/ksh: misc.c

Log Message:
Avoid arithmetics on strings.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/ksh/misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ksh/misc.c
diff -u src/bin/ksh/misc.c:1.24 src/bin/ksh/misc.c:1.25
--- src/bin/ksh/misc.c:1.24	Tue May  8 16:37:59 2018
+++ src/bin/ksh/misc.c	Tue Oct 29 16:19:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.24 2018/05/08 16:37:59 kamil Exp $	*/
+/*	$NetBSD: misc.c,v 1.25 2019/10/29 16:19:59 joerg Exp $	*/
 
 /*
  * Miscellaneous functions
@@ -6,7 +6,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: misc.c,v 1.24 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: misc.c,v 1.25 2019/10/29 16:19:59 joerg Exp $");
 #endif
 
 
@@ -1091,7 +1091,7 @@ print_value_quoted(s)
 	}
 	for (p = s; *p; p++) {
 		if (*p == '\'') {
-			shprintf("%s", "'\\'" + 1 - inquote);
+			shprintf("%s", &"'\\'"[1 - inquote]);
 			inquote = 0;
 		} else {
 			if (!inquote) {

Reply via email to