summaryrefslogtreecommitdiffstats
path: root/sys-utils/swapon-common.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/swapon-common.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/swapon-common.c')
-rw-r--r--sys-utils/swapon-common.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys-utils/swapon-common.c b/sys-utils/swapon-common.c
index bffedec..a4149a5 100644
--- a/sys-utils/swapon-common.c
+++ b/sys-utils/swapon-common.c
@@ -1,4 +1,16 @@
-
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * 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) 2012-2023 Karel Zak <kzak@redhat.com>
+ *
+ * Original implementation from Linux 0.99, without License and copyright in
+ * the code. Karel Zak rewrote the code under GPL-2.0-or-later.
+ */
#include "c.h"
#include "nls.h"
#include "xalloc.h"
@@ -85,7 +97,7 @@ static size_t ulct;
void add_label(const char *label)
{
- llist = xrealloc(llist, (++llct) * sizeof(char *));
+ llist = xreallocarray(llist, ++llct, sizeof(char *));
llist[llct - 1] = label;
}
@@ -101,7 +113,7 @@ size_t numof_labels(void)
void add_uuid(const char *uuid)
{
- ulist = xrealloc(ulist, (++ulct) * sizeof(char *));
+ ulist = xreallocarray(ulist, ++ulct, sizeof(char *));
ulist[ulct - 1] = uuid;
}