returning const char *.
-/* $OpenBSD: ls.c,v 1.50 2018/02/04 22:09:33 deraadt Exp $ */
+/* $OpenBSD: ls.c,v 1.51 2018/09/13 15:23:32 millert Exp $ */
/* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */
/*
int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser, maxlen;
int entries, needstats;
int width;
- char *user, *group, buf[21]; /* 64 bits == 20 digits */
+ const char *user, *group;
char nuser[12], ngroup[12];
+ char buf[21]; /* 64 bits == 20 digits */
char *flags = NULL;
/*
-/* $OpenBSD: fstat.c,v 1.93 2018/04/10 11:09:14 sthen Exp $ */
+/* $OpenBSD: fstat.c,v 1.94 2018/09/13 15:23:32 millert Exp $ */
/*
* Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
putchar('\n');
}
-char *Uname, *Comm;
+const char *Uname, *Comm;
uid_t *procuid;
pid_t Pid;
-/* $OpenBSD: sftp-common.c,v 1.30 2017/06/10 06:36:46 djm Exp $ */
+/* $OpenBSD: sftp-common.c,v 1.31 2018/09/13 15:23:32 millert Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2001 Damien Miller. All rights reserved.
{
int ulen, glen, sz = 0;
struct tm *ltime = localtime(&st->st_mtime);
- char *user, *group;
+ const char *user, *group;
char buf[1024], lc[8], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1];
char sbuf[FMT_SCALED_STRSIZE];
time_t now;
-/* $OpenBSD: pigs.c,v 1.30 2015/09/12 15:59:36 deraadt Exp $ */
+/* $OpenBSD: pigs.c,v 1.31 2018/09/13 15:23:32 millert Exp $ */
/* $NetBSD: pigs.c,v 1.3 1995/04/29 05:54:50 cgd Exp $ */
/*-
{
struct kinfo_proc *kp;
double value;
- char *uname, *pname;
+ const char *uname, *pname;
if (procbase == NULL)
return;
-/* $OpenBSD: machine.c,v 1.90 2018/05/14 12:31:21 mpi Exp $ */
+/* $OpenBSD: machine.c,v 1.91 2018/09/13 15:23:32 millert Exp $ */
/*-
* Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
}
char *
-format_next_process(caddr_t hndl, char *(*get_userid)(uid_t), pid_t *pid,
+format_next_process(caddr_t hndl, const char *(*get_userid)(uid_t), pid_t *pid,
int show_threads)
{
char *p_wait;
-/* $OpenBSD: machine.h,v 1.20 2015/05/06 07:53:29 mpi Exp $ */
+/* $OpenBSD: machine.h,v 1.21 2018/09/13 15:23:32 millert Exp $ */
/*
* Top users/processes display for Unix
extern caddr_t
get_process_info(struct system_info *, struct process_select *,
int (*) (const void *, const void *));
-extern char *format_next_process(caddr_t, char *(*)(uid_t), pid_t *, int);
+extern char *format_next_process(caddr_t, const char *(*)(uid_t), pid_t *, int);
extern uid_t proc_owner(pid_t);
extern struct kinfo_proc *getprocs(int, int, int *);
-/* $OpenBSD: top.c,v 1.90 2018/07/29 13:34:26 deraadt Exp $ */
+/* $OpenBSD: top.c,v 1.91 2018/09/13 15:23:32 millert Exp $ */
/*
* Top users/processes display for Unix
main(int argc, char *argv[])
{
char *uname_field = "USERNAME", *header_text, *env_top;
- char *(*get_userid)(uid_t) = username;
+ const char *(*get_userid)(uid_t) = username;
char **preset_argv = NULL, **av = argv;
int preset_argc = 0, ac = argc, active_procs, i;
sigset_t mask, oldmask;
-/* $OpenBSD: top.h,v 1.15 2013/09/21 14:15:19 espie Exp $ */
+/* $OpenBSD: top.h,v 1.16 2018/09/13 15:23:32 millert Exp $ */
/*
* Top users/processes display for Unix
extern void quit(int);
/* username.c */
-extern char *username(uid_t);
+extern const char *username(uid_t);
extern uid_t userid(char *);
-/* $OpenBSD: username.c,v 1.17 2015/10/26 13:56:18 tedu Exp $ */
+/* $OpenBSD: username.c,v 1.18 2018/09/13 15:23:32 millert Exp $ */
/*
* Top users/processes display for Unix
#include "top.h"
#include "utils.h"
-char *
+const char *
username(uid_t uid)
{
return user_from_uid(uid, 0);
-/* $OpenBSD: utils.c,v 1.26 2017/03/15 04:24:14 deraadt Exp $ */
+/* $OpenBSD: utils.c,v 1.27 2018/09/13 15:23:32 millert Exp $ */
/*
* Top users/processes display for Unix
* format_uid(uid) - like itoa, except for uid_t and the number is right
* justified in a 6 character field to match uname_field in top.c.
*/
-char *
+const char *
format_uid(uid_t uid)
{
static char buffer[16]; /* result is built here */
-/* $OpenBSD: utils.h,v 1.8 2005/06/08 22:36:43 millert Exp $ */
+/* $OpenBSD: utils.h,v 1.9 2018/09/13 15:23:32 millert Exp $ */
/*
* Top users/processes display for Unix
int atoiwi(char *);
char *itoa(int);
-char *format_uid(uid_t);
+const char *format_uid(uid_t);
int digits(int);
int string_index(char *, char **);
char **argparse(char *, int *);
-/* $OpenBSD: user.c,v 1.120 2017/05/24 09:18:15 mestre Exp $ */
+/* $OpenBSD: user.c,v 1.121 2018/09/13 15:23:32 millert Exp $ */
/* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */
/*
char buf[LINE_MAX];
char f[MaxFileNameLen];
char *colon;
- char *ugid = NULL;
+ const char *ugid = NULL;
int fd;
int cc;
int i;