Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst Do not assign to a const pointer, but ...



details:   https://anonhg.NetBSD.org/src/rev/16761d771ef8
branches:  trunk
changeset: 779864:16761d771ef8
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Jun 23 17:49:58 2012 +0000

description:
Do not assign to a const pointer, but set the value of the target variable
instead. Makes sysinst at least start up again.

diffstat:

 distrib/utils/sysinst/main.c |  17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diffs (31 lines):

diff -r f010a6f785d2 -r 16761d771ef8 distrib/utils/sysinst/main.c
--- a/distrib/utils/sysinst/main.c      Sat Jun 23 17:21:12 2012 +0000
+++ b/distrib/utils/sysinst/main.c      Sat Jun 23 17:49:58 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.65 2012/06/22 20:54:39 abs Exp $    */
+/*     $NetBSD: main.c,v 1.66 2012/06/23 17:49:58 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -128,15 +128,12 @@
        mnt2_mounted = 0;
        fd_type = "msdos";
 
-       for (arg = fflagopts; arg->name != NULL; arg++)
-               if (arg->var == cdrom_dev) {
-                       const char **dfltptr = __UNCONST(&arg->dflt);
-                       *dfltptr = get_default_cdrom();
-                       break;
-               }
-
-       for (arg = fflagopts; arg->name != NULL; arg++)
-               strlcpy(arg->var, arg->dflt, arg->size);
+       for (arg = fflagopts; arg->name != NULL; arg++) {
+               if (arg->var == cdrom_dev)
+                       strlcpy(arg->var, get_default_cdrom(), arg->size);
+               else
+                       strlcpy(arg->var, arg->dflt, arg->size);
+       }
        pkg.xfer_type = pkgsrc.xfer_type = "http";
 }
 



Home | Main Index | Thread Index | Old Index