Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ksh Avoid arithmetics on strings.



details:   https://anonhg.NetBSD.org/src/rev/60cd8f38e61d
branches:  trunk
changeset: 464939:60cd8f38e61d
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Oct 29 16:19:59 2019 +0000

description:
Avoid arithmetics on strings.

diffstat:

 bin/ksh/misc.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 110e4dc5bac8 -r 60cd8f38e61d bin/ksh/misc.c
--- a/bin/ksh/misc.c    Tue Oct 29 16:18:23 2019 +0000
+++ b/bin/ksh/misc.c    Tue Oct 29 16:19:59 2019 +0000
@@ -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 @@
        }
        for (p = s; *p; p++) {
                if (*p == '\'') {
-                       shprintf("%s", "'\\'" + 1 - inquote);
+                       shprintf("%s", &"'\\'"[1 - inquote]);
                        inquote = 0;
                } else {
                        if (!inquote) {



Home | Main Index | Thread Index | Old Index