Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/stdio Make opts.cmd const char * rather than ...



details:   https://anonhg.NetBSD.org/src/rev/ff9498967225
branches:  trunk
changeset: 1022211:ff9498967225
user:      kre <kre%NetBSD.org@localhost>
date:      Fri Jul 09 20:00:26 2021 +0000

description:
Make opts.cmd const char * rather than char * -- nothing ever modifies
the string it points to, it is never passed to a function not taking a
const char * arg, and this allows "" (or other literal strings if ever
needed) to be assigned to it - which should fix the build.

diffstat:

 tests/lib/libc/stdio/h_intr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 072e90e3740e -r ff9498967225 tests/lib/libc/stdio/h_intr.c
--- a/tests/lib/libc/stdio/h_intr.c     Fri Jul 09 19:11:06 2021 +0000
+++ b/tests/lib/libc/stdio/h_intr.c     Fri Jul 09 20:00:26 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: h_intr.c,v 1.3 2021/07/09 15:26:59 christos Exp $      */
+/*     $NetBSD: h_intr.c,v 1.4 2021/07/09 20:00:26 kre Exp $   */
 
 /**
  * Test of interrupted I/O to popen()ed commands.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: h_intr.c,v 1.3 2021/07/09 15:26:59 christos Exp $");
+__RCSID("$NetBSD: h_intr.c,v 1.4 2021/07/09 20:00:26 kre Exp $");
 
 #include <time.h>
 #include <err.h>
@@ -53,7 +53,7 @@
 
 /* Globals */
 static struct options {
-       char* cmd;              /* cmd to run (which must read from stdin) */
+       const char* cmd;        /* cmd to run (which must read from stdin) */
        size_t bsize;           /* block size to use */
        size_t asize;           /* alt. stdio buffer size */
        int btype;              /* buffering type: _IONBF, ... */



Home | Main Index | Thread Index | Old Index