diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
commit | 8bb05ac73a5b448b339ce0bc8d396c82c459b47f (patch) | |
tree | 1fdda006866bca20d41cb206767ea5241e36852f /sys-utils/readprofile.c | |
parent | Adding debian version 2.39.3-11. (diff) | |
download | util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.tar.xz util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.zip |
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | sys-utils/readprofile.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/sys-utils/readprofile.c b/sys-utils/readprofile.c index 579902d..6e6a68b 100644 --- a/sys-utils/readprofile.c +++ b/sys-utils/readprofile.c @@ -1,21 +1,14 @@ /* - * readprofile.c - used to read /proc/profile + * SPDX-License-Identifier: GPL-2.0-or-later * - * Copyright (C) 1994,1996 Alessandro Rubini (rubini@ipvvis.unipv.it) + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Copyright (C) 1994,1996 Alessandro Rubini (rubini@ipvvis.unipv.it) * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * readprofile.c - used to read /proc/profile */ /* @@ -88,14 +81,10 @@ static char *boot_uname_r_str(void) { struct utsname uname_info; char *s; - size_t len; if (uname(&uname_info)) return ""; - len = strlen(BOOT_SYSTEM_MAP) + strlen(uname_info.release) + 1; - s = xmalloc(len); - strcpy(s, BOOT_SYSTEM_MAP); - strcat(s, uname_info.release); + xasprintf(&s, "%s%s", BOOT_SYSTEM_MAP, uname_info.release); return s; } @@ -124,8 +113,8 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -r, --reset reset all the counters (root only)\n"), out); fputs(_(" -n, --no-auto disable byte order auto-detection\n"), out); fputs(USAGE_SEPARATOR, out); - printf(USAGE_HELP_OPTIONS(27)); - printf(USAGE_MAN_TAIL("readprofile(8)")); + fprintf(out, USAGE_HELP_OPTIONS(27)); + fprintf(out, USAGE_MAN_TAIL("readprofile(8)")); exit(EXIT_SUCCESS); } |