summaryrefslogtreecommitdiffstats
path: root/sys-utils/readprofile.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
commit1272be04be0cb803eec87f602edb2e3e6f111aea (patch)
treebce17f6478cdd9f3c4ec3d751135dc42786d6a56 /sys-utils/readprofile.c
parentReleasing progress-linux version 2.39.3-11~progress7.99u1. (diff)
downloadutil-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.tar.xz
util-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sys-utils/readprofile.c')
-rw-r--r--sys-utils/readprofile.c31
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);
}