Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/gen use VIS_NOLOCALE



details:   https://anonhg.NetBSD.org/src/rev/5c1df93ca852
branches:  trunk
changeset: 338418:5c1df93ca852
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 23 11:48:13 2015 +0000

description:
use VIS_NOLOCALE

diffstat:

 lib/libc/gen/utmpx.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 3383867dec73 -r 5c1df93ca852 lib/libc/gen/utmpx.c
--- a/lib/libc/gen/utmpx.c      Sat May 23 11:47:56 2015 +0000
+++ b/lib/libc/gen/utmpx.c      Sat May 23 11:48:13 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: utmpx.c,v 1.34 2015/05/23 09:18:01 mlelstv Exp $        */
+/*     $NetBSD: utmpx.c,v 1.35 2015/05/23 11:48:13 christos Exp $       */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 #include <sys/cdefs.h>
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: utmpx.c,v 1.34 2015/05/23 09:18:01 mlelstv Exp $");
+__RCSID("$NetBSD: utmpx.c,v 1.35 2015/05/23 11:48:13 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -308,12 +308,11 @@
        char buf[sizeof(*utx) * 4 + 1];
        pid_t pid;
        int status;
-       unsigned i;
 
        _DIAGASSERT(utx != NULL);
 
-       for (i=0; i<sizeof(*utx); ++i)
-               sprintf(&buf[4*i],"\\%03o",((const char*)utx)[i]);
+       (void)strvisx(buf, (const char *)(const void *)utx, sizeof(*utx),
+           VIS_WHITE | VIS_NOLOCALE);
        switch (pid = fork()) {
        case 0:
                (void)execl(_PATH_UTMP_UPDATE,



Home | Main Index | Thread Index | Old Index